This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games and have Dana Pylayeva on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

ScrollPane in JApplet

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to add a scrollpane to a Panel in an applet.But the scrollPane is not displaying..Can anyone able give a solution...
This is my coding,

private javax.swing.JScrollPane scrollpane;
private javax.swing.JPanel pane;
Container cont = getContentPane();
scrollpane = new JscrollPane(panel,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
container.add(scrollpane);
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
container.add(scrollpane); (where, presumably, 'container' is Container cont = getContentPane() ;)

here the scrollpane will occupy the frame (almost), so, for the scrollpane to work,
the panel needs to be a bigger size than that of the frame/scrollpane

e.g.
if the frame's size is (400,300), include this line and see what happens
panel.setPreferredSize(new Dimension(600,400));

if, by some chance, you are using a null layout, you have a lot of work ahead of you.
[edit] disable smileys
[ September 27, 2007: Message edited by: Michael Dunn ]
 
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic