aspose file tools
The moose likes Swing / AWT / SWT and the fly likes dynamically adding components Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "dynamically adding components" Watch "dynamically adding components" New topic
Author

dynamically adding components

Alan Shiers
Ranch Hand

Joined: Sep 24, 2003
Posts: 216
Hi there,

I'm trying a test by adding components dynamically to a GUI. In the following test I am able to add a JLabel or a JButton, but when it comes to a JTextArea nothing appears. Can someone explain what I need to do to make the JTextArea appear?

Please advise,

Alan

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 1176
    
    3

It does work it's just that at a size of 0 x 0 there's not much to see . If you give it a size via the constructor or add some text to it, it will display something that is visible.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: dynamically adding components
 
Similar Threads
Underline first character of a JButton?
GUI
GUI doesnt show
Using a JComboBox to change the contents of another JComboBox
Help with program structure