package net.sdls.barsita.ve; import javax.swing.SwingUtilities; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JButton; import java.awt.Rectangle; import javax.swing.JLabel; public class VETestFrame extends JFrame { private static final long serialVersionUID = 1L; private JPanel jContentPane = null; private JButton helloButton = null; private JLabel titleLabel = null; /** * This method initializes helloButton * * @return javax.swing.JButton */ private JButton getHelloButton() { if (helloButton == null) { helloButton = new JButton(); helloButton.setBounds(new Rectangle(105, 66, 89, 27)); helloButton.setText("Say Hello!"); helloButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { System.out.println("Hello World"); } }); } return helloButton; } /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ SwingUtilities.invokeLater(new Runnable() { public void run() { VETestFrame thisClass = new VETestFrame(); thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); thisClass.setVisible(true); } }); } /** * This is the default constructor */ public VETestFrame() { super(); initialize(); } /** * This method initializes this * * @return void */ private void initialize() { this.setSize(293, 200); this.setContentPane(getJContentPane()); this.setTitle("JFrame"); } /** * This method initializes jContentPane * * @return javax.swing.JPanel */ private JPanel getJContentPane() { if (jContentPane == null) { titleLabel = new JLabel(); titleLabel.setBounds(new Rectangle(1, 1, 183, 28)); titleLabel.setText("ボタンを押すと挨拶します"); jContentPane = new JPanel(); jContentPane.setLayout(null); jContentPane.add(getHelloButton(), null); jContentPane.add(titleLabel, null); } return jContentPane; } } // @jve:decl-index=0:visual-constraint="10,10"