• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in Swing

 
Ranch Hand
Posts: 103
jQuery Netbeans IDE Notepad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
I am really stucked in this thing.
I am writing a simple Swing program to add a JButton and JTextField on a
JFrame.
On running the code, the button is displayed only when I point to the location using mouse.
text field is having same problem.

Please suggest what to do?
Thanks in advance
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Hm ... it sounds to me like a feature and not a bug. ;)

So, in order to help you, you should share with us your code sample/snip.
Since this are Swing basis, the code should not be that long.

You can also check the following example (with one component - JLabel):
http://java.sun.com/docs/books/tutorial/uiswing/examples/components/FrameDemoProject/src/components/FrameDemo.java
Just for crosschecking.


Regards,
Rok
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

the button is displayed only when I point to the location using mouse. text field is having same problem.



The order of the code should be:



If you add components after the frame is visible then you need to do:

reply
    Bookmark Topic Watch Topic
  • New Topic