How do I arrange JPanels from top to bottom?
问题 I'm currently self-studying Java. I'm learning Graphical User Interface(GUI) programming. I want JPanel s to be arranged from top to bottom in a JFrame .First of all,I have a JLabel added to the first JPanel . The second JPanel has 5 JRadioButtions . The third JPanel has a JButton and a JLabel . When the JButton is pressed,the JLabel in the 3 rd JPanel shows some text. I used BoxLayout ( BoxLayout.X_AXIS ) for all the JPanels and added all 3 of them into a JFrame which has FlowLayout() . Here