aspose file tools*
The moose likes Java in General and the fly likes Scrollbar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Scrollbar" Watch "Scrollbar" New topic
Author

Scrollbar

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
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

Joined: Jan 30, 2000
Posts: 18671
Sounds like you need a JTabbedPane.


"I'm not back." - Bill Harding, Twister
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Thanks Ji,
But I have to use AWT!
Thanks
angela

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

Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
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.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Thanks Frank ,
Plz let me know the site for AWT tabbed Panel,

Thanks again,
angela
bhuvan gupta
Greenhorn

Joined: Mar 26, 2001
Posts: 13
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

Joined: Nov 27, 2000
Posts: 428
Thanks Bhuvan,
angela

Jeffrey Ang
Greenhorn

Joined: Mar 26, 2001
Posts: 6
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

Joined: Oct 18, 2000
Posts: 4121

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


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Scrollbar