user interface - Java JTextField wont show -
I am creating some GUI and I have made this JDialog where I try to create a template for name, phone number I am doing, and my problem of age is that when you press the button, you call this method:
making the public zero () {JDialog addDialog = new JDialog ( Frame); JP Penal Ad ContentPan = (JPNL) addDialog.getContentPane (); AddContentPane.setBorder (new blank border (12,12,12,12)); AddContentPane.setLayout (new border layout (6,6)); AddDialog.setTitle ("Opret Kunde"); AddDialog.setSize (800, 400); AddDialog.setLocationRelativeTo (frame); AddDialog.setModal (true); AddDialog.setVisible (true); Japanese add-content = new zpn (); AddContent.setLayout (new gridlate (4,4)); JTextField addName = new JTextField (50); AddContent.add (addName); JTextField addAge = new JTextField (50); AddContent.add (addage); JTextField addPhone = new JTextField (50); AddContent.add (addPhone); AddContentPane.add (ad-content, border layout. Vest); AddDialog.add (addContentPane); } I can not just show the textfield in my JDIOL. I do not know where the problem should be?
You have to show your JDILOG, add it to the end and remove it from the top:
addDialog.setVisible (true); As far as I remember the Java swing, you can not see anything before and can create it.
Here you have another XML:
Private Zero Show SimpleogyLog () {last JDLOgh D = new JDialog (this, "run", true); D.setSize (200, 150); JLab L = New JLABEL ("paging swing demo", JLABEL. CEF); D.getContentPane () .setLayout (new border layout ()); D.getContentPane () .add (l, BorderLayout.CENTER); Jebton B = new pocket ("run"); B.addActionListener (new executor) {ActionEvent ev} {createFrame (); d.setVisible (wrong); d.dispose ();}}); Jpnal p = new jepinal (); // Flow layout center button will be p.add (b); D.getContentPane () .add (P, Border Layout. South); D.setLocationRelativeTo (this); D.setVisible (true); }
Comments
Post a Comment