• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

ScrollBar on a Frame ??

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I once met a man from Nantucket. He had a tiny ad
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic