File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel " Watch "JPanel " New topic


Shahjehan Tariq

Joined: Feb 17, 2006
Posts: 3

I am working in Swings and have a problem. I have a Main panel on which i have added a button and set a image on that buttons. on main panel i add different panels having buttons on them. i have set panels Opaque to false but when programe excutes only image which is in main panel appear and other panels with button not appear. when i roll over the mouse then buttons appears. please guide how buttons can be appear directly with out roll over of mouse



Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> please guide how buttons can be appear directly with out roll over of mouse

post your code
Nageswar Kakolla
Ranch Hand

Joined: Jan 16, 2006
Posts: 71
specify which Layout you are using and before you add any subpanels to Mainpanel, JPanel.setLayout(new BorderLayout()); or any layout.

Also check when you are add subpanel to main panel, is it correctly ?
subject: JPanel
Similar Threads
Loading and unloading a panel
Drag and drop over an iframe
JViewPort problems
Custom (image) button