Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scrollbar

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have page in which i have following:
(1)Three tables like Table1,Table2,Table3
(2) I have three Labels: L1,L2,L3 at the top of the page
(3) Now When I clicked L1, COmputer screen should jump to Table1 directly.When I clicked L2, computer screen should jump to Table2, and so on...
Plz let me know how can i do it...
Thanks,
Angela
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you need a JTabbedPane.
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ji,
But I have to use AWT!
Thanks
angela

Originally posted by Jim Yingst:
Sounds like you need a JTabbedPane.

 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote an AWT tabbed panel a while back which I will try and dig up and put on a web site somewhere for you to grab and use. I'll put the URL here when I've found it.
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frank ,
Plz let me know the site for AWT tabbed Panel,

Thanks again,
angela
 
bhuvan gupta
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Angela,
If U just want to use Awt I have one solution
u can use it if it suits u
1. Create Three Tables on three different panels
Say Table-1 on Panel-1
Table-2 on Panel-2
Table-3 on Panel-3
and 3 buttons on some other Panel (panel4)
Panel 4 will always be visible
where only one of Panel-1, Panel-2, Panel-3
is visible depending on the Button pressed on the Panel 4
So on pressing Button-1 u can show just Panel-1
and make Panel 2 and 3 invisible
and on clicking Button 2 show panel 2
and so on
This concept is similar to Layers in HTML where u can show one layer over the other ..

bhuvan
Originally posted by Angela Jessi:
Hi,
I have page in which i have following:
(1)Three tables like Table1,Table2,Table3
(2) I have three Labels: L1,L2,L3 at the top of the page
(3) Now When I clicked L1, COmputer screen should jump to Table1 directly.When I clicked L2, computer screen should jump to Table2, and so on...
Plz let me know how can i do it...
Thanks,
Angela


[This message has been edited by bhuvan gupta (edited April 11, 2001).]
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bhuvan,
angela

 
Jeffrey Ang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest a simple solution. Use a Frame with a BorderLayout. Put the three labels in a Panel with a FlowLayout. Then put the panel in the NORTH of the Frame. After that, put the tables in a second Panel with a CardLayout. Then put the second Panel in the CENTER of the Frame. Then call the appropriate methods of the CardLayout to show the appropriate table when a user clicks the appropriate label. A CardLayout shows only one component at a time. Use a MouseListener to catch the mouse clicks.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeffrey's solution is probably the best answer... and guess what?!?!? I had some code lying around that is almost exactly what you need... hope it gives you some idea of how to implement your solution!

HTH,
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic