I’ve got to create two JLabels, and the should been positioned center and right under each other in the JFrame. I’ve beeing using the gridbaglayout from swing, but I can’t figure out how to do this.
terminalLabel = new JLabel("No reader connected!", SwingConstants.CENTER);
terminalLabel.setVerticalAlignment(SwingConstants.TOP);
cardlabel = new JLabel("No card presented", SwingConstants.CENTER);
cardlabel.setVerticalAlignment(SwingConstants.BOTTOM);
Use a BoxLayout. In the code below the Box class is a convenience class that creates a JPanel that uses a BoxLayout: