This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

scroll pane  RSS feed

 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
trying to add a scroll pane to my jframe. this is my code in the main.

i then have a paint() method.
Where do i add the scroll pane. what i cant understand is what do i add in the scroll pane. so that i can add it to the container.(this is as far as i understand abt scroll pane).enlighten me please
thank u
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You place a component that implements the javax.swing.Scrollable interface into the JScrollPane, then you place the JScrollPane into the container, for example, here I'm adding a scrollable JTextArea to a JFrame:
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!