Hi all, I have a little GUI with 5 buttons down the left and a text area on the right, it does not display the text area unless i instantiate it with some text, and even then, its only 1 line big. How can i get it to show when i run my app on the entire right hand side of my GUI? Also, how do I set the size of my GUI, I want it to start in a position centered in my screen and at least double the sixe it is at the moment. My code is attached. Many thanks Ian
You could add the JTextArea to the center of your BorderLayout directly and not to a panel first. There should be some center logic in this forum somewhere. Try a search and let us know if you find it. We really need a forum FAQ.
Hi Ian, For the textarea, u can set the size using setPreferredSize.. u that u need not have to instantiate textarea with some text... If you are using BorderLayout, put the entire app in the center.. If you want you GUI to appear in the center of th e window, then use the following code : JDialog d = new JDialog(); Dimension size = d.getToolkit().getScreenSize(); setLocation((size.width - 750) / 2, (size.height - 500) / 2); Hope this helps you, Deepa Raghuraman
Post by:autobot
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
a bit of art, as a gift, the permaculture playing cards