Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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

Nested JPanels

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a very large applet that cannot fit onto a browser window so I added a JScrollPane to the JApplet as follows:
getContentPane().add(scrollPane)
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
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic