Java - Scrollable Menu

0

Good morning,

How do I make my menu scrollable? I've been reigning a little more I do not know how to do this in jFrame. Could someone guide me? Many thanks!

    
asked by anonymous 13.12.2015 / 11:37

1 answer

1

Good morning Junior

It is possible using a JScrollPane, add one or more Component (s) to it and then add it to the frame you are using, be it a JFrame or another.

Ex:

public class Exemplo {
   public static void main(String[] args) {
       JFrame jFrame = new JFrame();
       JPanel jPanel = new JPanel(); //component
       JScrollPane pane = new JScrollPane(jPanel); 
       jFrame.setContentPane(pane);
   }
}

Here you can find other examples link

    
13.12.2015 / 14:03