• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tabbed panel in AWT  RSS feed

 
Jesper Ottosson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on an applet which can't use any Swing components, and I need some component that does quite the same thing as JTabbedPane, but I seem unable to find one. Is there really no such thing in AWT, and what am I supposed to do then?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper,
Look into CardLayout. It is the layout manager that will let you best approximate a tabbed pane. I would use BorderLayout on the top level, add a Panel with CardLayout in the center, and add a panel with several buttons along the top to control which "card" to show.
HTH,
-Nate
 
Jesper Ottosson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand what you mean, but i can't see any way at all of making that look good... really, i have to have tabs that look pretty much like tabs in Swing or in Windows
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can make images (or if you really want to you can draw them with the AWT) that look like the tabs in the chosen and background positions, add them to a Canvas with a MouseListener, make them switch images and middle panel of the frame when clicked on, and *BANG* you have a tabbed pane... just make sure you match the color of the tabs to the background color of the middle panel... This can't be too hard... I have seen people do the same thing with HTML, JavaScript, and a few choice images...
HTH,
-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!