FormattedTextField implemented

This commit is contained in:
Karl Tauber
2019-08-21 14:37:58 +02:00
parent d0a7ded92b
commit faed3fabc6
7 changed files with 120 additions and 16 deletions

View File

@@ -71,6 +71,11 @@ public class FlatComponentsTest
JTextField textField2 = new JTextField();
JTextField textField3 = new JTextField();
JTextField textField4 = new JTextField();
JLabel formattedTextFieldLabel = new JLabel();
JFormattedTextField formattedTextField1 = new JFormattedTextField();
JFormattedTextField formattedTextField2 = new JFormattedTextField();
JFormattedTextField formattedTextField3 = new JFormattedTextField();
JFormattedTextField formattedTextField4 = new JFormattedTextField();
//======== this ========
setLayout(new MigLayout(
@@ -87,6 +92,8 @@ public class FlatComponentsTest
"[]" +
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- labelLabel ----
@@ -206,6 +213,30 @@ public class FlatComponentsTest
textField4.setEnabled(false);
textField4.setEditable(false);
add(textField4, "cell 4 4,growx");
//---- formattedTextFieldLabel ----
formattedTextFieldLabel.setText("JFormattedTextField:");
add(formattedTextFieldLabel, "cell 0 5");
//---- formattedTextField1 ----
formattedTextField1.setText("editable");
add(formattedTextField1, "cell 1 5,growx");
//---- formattedTextField2 ----
formattedTextField2.setText("disabled");
formattedTextField2.setEnabled(false);
add(formattedTextField2, "cell 2 5,growx");
//---- formattedTextField3 ----
formattedTextField3.setText("not editable");
formattedTextField3.setEditable(false);
add(formattedTextField3, "cell 3 5,growx");
//---- formattedTextField4 ----
formattedTextField4.setText("not editable disabled");
formattedTextField4.setEnabled(false);
formattedTextField4.setEditable(false);
add(formattedTextField4, "cell 4 5,growx");
// JFormDesigner - End of component initialization //GEN-END:initComponents
}

View File

@@ -9,7 +9,7 @@ new FormModel {
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5"
"$columnConstraints": "[][][][][][]"
"$rowConstraints": "[][][][][]"
"$rowConstraints": "[][][][][][][]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JLabel" ) {
@@ -178,6 +178,40 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 4,growx"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "formattedTextFieldLabel"
"text": "JFormattedTextField:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 5"
} )
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
name: "formattedTextField1"
"text": "editable"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5,growx"
} )
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
name: "formattedTextField2"
"text": "disabled"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 5,growx"
} )
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
name: "formattedTextField3"
"text": "not editable"
"editable": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 5,growx"
} )
add( new FormComponent( "javax.swing.JFormattedTextField" ) {
name: "formattedTextField4"
"text": "not editable disabled"
"enabled": false
"editable": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 5,growx"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 580, 300 )

View File

@@ -14,6 +14,11 @@
# limitations under the License.
#
#---- variables ----
@textComponentBackground=ffffff
#---- globals ----
*.background=ccffcc
@@ -70,8 +75,3 @@ Component.focusColor=97c3f3
Label.foreground=008800
Label.disabledForeground=000088
#---- TextField ----
TextField.background=ffffff