1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
| public class FormScan extends JFrame {
private JTextField jTextFieldchemin = new JTextField();
private JLabel jLabelchemin = new JLabel();
private JButton scanner = new JButton();
private JLabel jLabelresultat = new JLabel();
public FormScan() {
addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e) {intaction=_popupTransactionDialog();
if (action!=JOptionPane.CLOSED_OPTION){ panelBinding.releaseDataControl(); statusBar.release();System.exit(0);} } });
}
private GridLayout gridLayout = new GridLayout();
private BorderLayout borderLayout = new BorderLayout();
private JUPanelBinding panelBinding = new JUPanelBinding("FormScanPageDef");
private JUStatusBar statusBar = new JUStatusBar();
private JPanel topPanel = new JPanel();
private JPanel dataPanel = new JPanel();
private JUNavigationBar hiddenNavBar = new JUNavigationBar();
private void registerProjectGlobalVariables(BindingContext bindCtx) {
JUUtil.registerNavigationBarInterface(panelBinding, bindCtx);
}
private void unRegisterProjectGlobalVariables(BindingContext bindCtx) {
JUUtil.unRegisterNavigationBarInterface(panelBinding, bindCtx);
}
/**the JbInit method
*/
public void jbInit() throws Exception {
dataPanel.setLayout(null);
this.getContentPane().setLayout(gridLayout);
topPanel.setLayout(borderLayout);
this.getContentPane().add(topPanel);
this.setSize(new Dimension(696, 461));
this.setTitle("Scan");
dataPanel.add(jLabelresultat, null);
dataPanel.add(scanner, null);
dataPanel.add(jLabelchemin, null);
dataPanel.add(jTextFieldchemin, null);
topPanel.add(dataPanel, BorderLayout.CENTER);
topPanel.add(statusBar, BorderLayout.SOUTH);
hiddenNavBar.setModel(JUNavigationBar.createPanelBinding(panelBinding, hiddenNavBar));
scanner.setText("Scanner");
scanner.setBounds(new Rectangle(580, 25, 100, 25));
scanner.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
scanner_actionPerformed(e);
}
});
jTextFieldchemin.setBounds(new Rectangle(165, 25, 355, 25));
jLabelchemin.setText("Chemin Module");
jLabelchemin.setBounds(new Rectangle(55, 30, 95, 15));
statusBar.setModel(JUStatusBar.createPanelBinding(panelBinding, statusBar));
}
public static void main(String [] args) {
try {
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
} catch (ClassNotFoundException cnfe) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception exemp) {
exemp.printStackTrace();
}
} catch (Exception exemp) {
exemp.printStackTrace();
}
try {
JUMetaObjectManager.setErrorHandler(new JUErrorHandlerDlg());
JUMetaObjectManager mgr = JUMetaObjectManager.getJUMom();
mgr.setJClientDefFactory(null);
BindingContext ctx = new BindingContext();
ctx.put(DataControlFactory.APP_PARAM_ENV_INFO, new JUEnvInfoProvider());
ctx.setLocaleContext(new DefLocaleContext(null));
HashMap map = new HashMap(4);
map.put(DataControlFactory.APP_PARAMS_BINDING_CONTEXT, ctx);
mgr.loadCpx("data.DataBindings.cpx" , map);
final FormScan frame = new FormScan();
frame.setBindingContext(ctx);
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
frame.setLocation((screenSize.width - frameSize.width)/2, (screenSize.height - frameSize.height)/2);
frame.setVisible(true);
} catch (Exception ex) {
JUMetaObjectManager.reportException(null, ex, true);
System.exit(1);
}
}
} |
Partager