Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Don Sims   on Jan 11 In Java Category.

  
Question Answered By: Dep Tran   on Jan 11

Have you checked Java Online Source for the sample
source code? I do not have source code  available, but
according to the way I interpreted your question is
create a Frame, add scrolling  pane feature, and then
some other components.

////////////
// creat a frame  named Scroll Bar Demo
public class ScrollDemo extends JFrame {
public ScrollDemo() {
super("Scroll Bar Demo");
setSize(300,250);
CustomScrollPane sp=new CustomScrollPane(new
JLabel());
getContentPane().add(sp); // add  Scrollpane to
Frame
// add other components  if you wanted to

WindowListener wndCloser=new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
};
addWindowListener(wndCloser); // register window
listener
setVisible(true); // without this you can not see
the frame
}

// execute application
public static void main(String[] args) {
new ScrollDemo(); // create a new application
}
}
}

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on scrolling feature in a frame Or get search suggestion and latest updates.


Tagged: