aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes ScrollBar on a Frame ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ScrollBar on a Frame ??" Watch "ScrollBar on a Frame ??" New topic
Author

ScrollBar on a Frame ??

Nicolas Viollin
Greenhorn

Joined: Apr 13, 2001
Posts: 26
I would like to print a list of the fonts available on a system, with a exemple of each fonts in different sizes.
but how to set a scrollbar on a frame, and is it possible
maybe on a panel ???
thnx
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I assume you are using AWT because you just said frame and panel. I was using Swing, but should work the same. Here is what I did.
I created a JFrame then set a JPanel as it's contentPane. Then I created a JScrollPane and placed that on my JFrame. I then created another JPanel and placed it inside the JScrollPane. Be sure and set the JScrollPane Deminsions no larger than the JFrame, but the JPanel you place inside can be any size you want. Or you could use a JTextArea or whatever. Doesn't have to be a JPanel.
Hope that helps. If you need some code, let me know.

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
hi,
there is no ScrollPane for AWT. at least, Swing and AWT work quite different at this point. if you're not urged to use AWT, than use Swing. it's newer, better, buggylesser etc.
chantal
 
wood burning stoves
 
subject: ScrollBar on a Frame ??