• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ScrollBar on a Frame ??

 
Nicolas Viollin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic