i have a JFrame, JPanel and a JButton, the button is in the panel at coords (100, 1000), the panel (with absolute layout) is in the frame and the frame has dimensions (500, 500). what i want is to be able to scroll the window in order to reach the button that is under the window bottom. here is the code:
public static void main(String...args)
{
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JButton button = new JButton("Test");
frame.setSize(500, 500);
frame.getContentPane().add(panel);
panel.setLayout(null);
button.setBounds(100, 1000, 100, 30);
panel.add(button);
}
how can i do to be able to scroll the window to reach the button? could you write a simple code with this button?