Takuya Ono
takuy****@users*****
2005年 11月 6日 (日) 16:58:36 JST
Index: BetaProject/src/org/jent/checksmtp/ToListDialog.java diff -u BetaProject/src/org/jent/checksmtp/ToListDialog.java:1.3 BetaProject/src/org/jent/checksmtp/ToListDialog.java:1.4 --- BetaProject/src/org/jent/checksmtp/ToListDialog.java:1.3 Sun Nov 6 06:10:48 2005 +++ BetaProject/src/org/jent/checksmtp/ToListDialog.java Sun Nov 6 16:58:36 2005 @@ -9,7 +9,7 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.util.ArrayList; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.JButton; @@ -17,6 +17,7 @@ import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.UIManager; public class ToListDialog extends JDialog { @@ -24,7 +25,7 @@ private JButton jButtonCANCEL = new JButton(); private JList jList1 = new JList(); private JScrollPane scrollPane = new JScrollPane(); //add - private ArrayList toList = null; + private List toList = null; private ResultNotify resultNotify = null; private JPanel bottonPanel = new JPanel(); @@ -46,7 +47,7 @@ } } - public ToListDialog(ResultNotify processer, ArrayList toList) { + public ToListDialog(ResultNotify processer, List toList) { this(null, "TO Check", false); this.toList = toList; this.resultNotify = processer; @@ -62,6 +63,7 @@ } private void jbInit() throws Exception { + this.setLookAndFeelSuitable(); this.setSize(new Dimension(584, 300)); this.getContentPane().setLayout(borderLayout1); this.setTitle("Conform Mail Destination"); @@ -80,12 +82,12 @@ jButtonOK.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - jButton1_actionPerformed(e); + jButtonOK_actionPerformed(e); } }); jButtonCANCEL.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - jButton2_actionPerformed(e); + jButtonCANCEL_actionPerformed(e); } }); jButtonOK.setText("OK"); @@ -97,15 +99,29 @@ this.getContentPane().add(bottonPanel, BorderLayout.SOUTH); this.getContentPane().add(scrollPane, BorderLayout.CENTER); + + //Display Center setLocationRelativeTo(null); + //setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); //Default + } + + /* + * set OS default look&feel + */ + private void setLookAndFeelSuitable() { + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } catch (Exception e) { + e.printStackTrace(); + } } - private void jButton1_actionPerformed(ActionEvent e) { + private void jButtonOK_actionPerformed(ActionEvent e) { //push OK resultNotify.sayOK(); this.dispose(); } - private void jButton2_actionPerformed(ActionEvent e) { + private void jButtonCANCEL_actionPerformed(ActionEvent e) { resultNotify.sayNG(); this.dispose(); }