#副標= Layout Manager介紹 #大標=Swing的排版應用(1) #眉標=Swing #作者=文/歐宣修 --------------------------box 程式1--------------------------- TestBorderLayout test = new TestBorderLayout(); test.setVisible(true); ----------------------------end------------------------------ ---------------------------box 程式2---------------------- jLabel2.setText("South"); jLabel2.setPreferredSize(new java.awt.Dimension(33,100)); //…(1) jLabel.setText("North"); jLabel.setPreferredSize(new java.awt.Dimension(31,50)); ... jContentPane.setLayout(new BorderLayout()); //…(2) jContentPane.add(jLabel2, java.awt.BorderLayout.SOUTH); //…(3) jContentPane.add(jLabel1, java.awt.BorderLayout.CENTER); jContentPane.add(jLabel, java.awt.BorderLayout.NORTH); -------------------------------end------------------------ -----------------------box 程式3-------------------------- jButton.setPreferredSize(new java.awt.Dimension(100,50)); //…(1) jButton.setText("First"); ... jContentPane.setLayout(new FlowLayout()); //…(2) jContentPane.add(getJButton2(), null); //…(3) jContentPane.add(getJButton1(), null); jContentPane.add(getJButton(), null); ---------------------------end----------------------------