• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Tabbed panel in AWT

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic