Sunday 15 September 2013

java - JFrame not displaying, nothing is displaying -



java - JFrame not displaying, nothing is displaying -

i have no thought why jframe isn't displaying , bugging me , sense i'm missing easy , i'm not seeing it. help awesome!

here code:

import java.awt.*; import java.awt.eventqueue; import javax.swing.*; import javax.swing.grouplayout.*; public class lorenzo_chatclient_class extends jframe { private jpanel contentpane; private jtextfield textfield; private jtextfield textfield_1; public static void main(string[] args) { eventqueue.invokelater(new runnable() { public void run() { seek { lorenzo_chatclient_class frame = new lorenzo_chatclient_class(); frame.setvisible(true); } grab (exception e) { e.printstacktrace(); } } }); } /** create frame. */ public lorenzo_chatclient_class() { //setdefaultcloseoperation(jframe.exit_on_close); setbounds(100, 100, 450, 300); jframe frame = new jframe(); frame.setsize(100,100); contentpane = new jpanel(); contentpane.setborder(new emptyborder(5, 5, 5, 5)); setcontentpane(contentpane); contentpane.setlayout(null); textfield_1 = new jtextfield(); textfield_1.setbounds(0, 244, 450, 34); contentpane.add(textfield_1); textfield_1.setcolumns(10); jbutton btnnewbutton = new jbutton("send"); btnnewbutton.setbounds(351, 6, 99, 122); contentpane.add(btnnewbutton); jbutton btnnewbutton_1 = new jbutton("quit"); btnnewbutton_1.setbounds(351, 124, 99, 122); contentpane.add(btnnewbutton_1); jtextarea textarea_1 = new jtextarea(); textarea_1.setborder(uimanager.getborder("editorpane.border")); textarea_1.setbounds(6, 6, 345, 240); contentpane.add(textarea_1); jtextarea textarea = new jtextarea(); textfield = new jtextfield(); textfield.setcolumns(10); } }

in main method ,

lorenzo_chatclient_class frame = new lorenzo_chatclient_class();

in constructor,

setbounds(100, 100, 450, 300); jframe frame = new jframe(); frame.setsize(100,100); have taken class reference , jframe names same "frame".

java jframe

No comments:

Post a Comment