What’s the biggest and smallest number that can be used in: pane.add() ?
public class Main {
public static void main(String[] args) {
JLayeredPane pane = new JLayeredPane();
pane.setPreferredSize(new Dimension(500,500));
pane.setBackground(Color.pink);
pane.setOpaque(true);
JPanel blueBox = new JPanel();
blueBox.setBounds(100,100,100,100);
blueBox.setBackground(Color.BLUE);
JPanel redBox = new JPanel();
redBox.setBounds(150,100,100,100);
redBox.setBackground(Color.RED);
pane.add(blueBox, Integer.valueOf(-948884));
pane.add(redBox, Integer.valueOf(1009499595));
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(pane);
frame.pack();
frame.setVisible(true);
}
}
I read the docs but didn’t find the answer: https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/JLayeredPane.html
My guess is: the smallest number is the smallest int number and the largest is the biggest int number but i want to be sure ????