This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Nested JPanels 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 "Nested JPanels" Watch "Nested JPanels" New topic

Nested JPanels

Joe Guzzardo
Ranch Hand

Joined: Mar 14, 2000
Posts: 57
I have a very large applet that cannot fit onto a browser window so I added a JScrollPane to the JApplet as follows:
To this scroll pane I added a JPanel, lets call it mainPanel, which in turn contains all the other JPanels that make up the JApplet. My problem is that I can move the cursor into the editable fields that appear in the first JPanel under the mainPanel but none of the other JPanels that follow it.
Any help would be appreciated. TIA, Joe
Joe Guzzardo
Ranch Hand

Joined: Mar 14, 2000
Posts: 57
After looking thru the code a little more closely I discovered that the panels were AWT Panels and not Swing JPanels. The documentation clearly states that one should not mix AWT and Swing components together in the same application. After modifying the applet to use only Swing components everything worked out fine.
jQuery in Action, 2nd edition
subject: Nested JPanels
Similar Threads
Just finished my first GUI program (a planner application) ... could you give me feedback?
Linking two JPanels with a JButton
Painting to a specific component.
Handling repaint