src/org/objectweb/cjdbc/console/gui/frames/GuiNewControllerFrame.java

説明を見る。
00001 00025 package org.objectweb.cjdbc.console.gui.frames; 00026 00027 import java.awt.Dimension; 00028 import java.awt.FlowLayout; 00029 import java.awt.Toolkit; 00030 import java.awt.event.ActionListener; 00031 00032 import javax.swing.JButton; 00033 import javax.swing.JFrame; 00034 import javax.swing.JLabel; 00035 import javax.swing.JTextField; 00036 00037 import org.objectweb.cjdbc.common.i18n.GuiTranslate; 00038 import org.objectweb.cjdbc.console.gui.constants.GuiCommands; 00039 00046 public class GuiNewControllerFrame extends JFrame 00047 { 00048 private JTextField portNumber; 00049 private JTextField ipAddressBox; 00050 private ActionListener actionListener; 00051 00057 public GuiNewControllerFrame(ActionListener listener) 00058 { 00059 super(GuiTranslate.get("frame.controller.title")); 00060 this.actionListener = listener; 00061 Toolkit toolkit = Toolkit.getDefaultToolkit(); 00062 Dimension dim = toolkit.getScreenSize(); 00063 int screenHeight = dim.height; 00064 int screenWidth = dim.width; 00065 int frameWidth = 450; 00066 int frameHeight = 50; 00067 this.setBounds((screenWidth - frameWidth) / 2, 00068 (screenHeight - frameHeight) / 2, frameWidth, frameHeight); 00069 this.validate(); 00070 this.setVisible(false); 00071 this.getContentPane().setLayout(new FlowLayout()); 00072 00073 this.getContentPane().add(new JLabel(GuiTranslate.get("frame.controller.host"))); 00074 ipAddressBox = new JTextField(0); 00075 ipAddressBox.setAlignmentX(CENTER_ALIGNMENT); 00076 ipAddressBox.setText("localhost"); 00077 ipAddressBox.addActionListener(actionListener); 00078 this.getContentPane().add(ipAddressBox); 00079 00080 this.getContentPane().add(new JLabel(GuiTranslate.get("frame.controller.port"))); 00081 portNumber = new JTextField(0); 00082 portNumber.setAlignmentX(CENTER_ALIGNMENT); 00083 portNumber.setText("1090"); 00084 portNumber.addActionListener(actionListener); 00085 this.getContentPane().add(portNumber); 00086 00087 JButton optionConfirm = new JButton(GuiTranslate.get("frame.ok")); 00088 optionConfirm.setActionCommand(GuiCommands.COMMAND_ADD_CONTROLLER_APPROVE); 00089 optionConfirm.addActionListener(actionListener); 00090 this.getContentPane().add(optionConfirm); 00091 00092 JButton optionCancel = new JButton(GuiTranslate.get("frame.cancel")); 00093 optionCancel.setActionCommand(GuiCommands.COMMAND_ADD_CONTROLLER_CANCEL); 00094 optionCancel.addActionListener(actionListener); 00095 this.getContentPane().add(optionCancel); 00096 00097 this.setVisible(false); 00098 this.setDefaultCloseOperation(HIDE_ON_CLOSE); 00099 this.validate(); 00100 } 00106 public JTextField getIpAddressBox() 00107 { 00108 return ipAddressBox; 00109 } 00115 public JTextField getPortNumber() 00116 { 00117 return portNumber; 00118 } 00119 }

CJDBCversion1.0.4に対してTue Oct 12 15:15:58 2004に生成されました。 doxygen 1.3.8