List of usage examples for com.jgoodies.forms.layout FormLayout FormLayout
public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs)
From source file:ChatMenu.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Jurko Guba dialogPane = new JPanel(); contentPanel = new JPanel(); label1 = new JLabel(); label2 = new JLabel(); scrollPane1 = new JScrollPane(); textArea1 = new JTextArea(); scrollPane2 = new JScrollPane(); textArea2 = new JTextArea(); textField1 = new JTextField(); okButton = new JButton(); //======== this ======== setResizable(false);/* w ww . ja v a2s .c o m*/ setVisible(true); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.createEmptyBorder("7dlu, 7dlu, 7dlu, 7dlu")); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout( new FormLayout("292dlu, $lcgap, 57dlu, 0dlu", "default, $lgap, 221dlu, $lgap, 18dlu")); //---- label1 ---- label1.setText("Chat room"); contentPanel.add(label1, CC.xy(1, 1)); //---- label2 ---- label2.setText("Online: 0"); contentPanel.add(label2, CC.xy(3, 1)); //======== scrollPane1 ======== { //---- textArea1 ---- textArea1.setEditable(false); scrollPane1.setViewportView(textArea1); } contentPanel.add(scrollPane1, CC.xywh(1, 3, 1, 2)); //======== scrollPane2 ======== { //---- textArea2 ---- textArea2.setEditable(false); scrollPane2.setViewportView(textArea2); } contentPanel.add(scrollPane2, CC.xywh(3, 3, 2, 2)); contentPanel.add(textField1, CC.xy(1, 5)); //---- okButton ---- okButton.setText("Send"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { sendButtonPressed(e); okButtonActionPerformed(e); sendButtonPressed(e); } }); contentPanel.add(okButton, CC.xywh(3, 5, 2, 1)); } dialogPane.add(contentPanel, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:MainView.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license panel1 = new JPanel(); menuBar = new JMenuBar(); fileMenu = new JMenu(); quitMenuItem = new JMenuItem(); accountsMenu = new JMenu(); manageAccountsMenuItem = new JMenuItem(); addAccountMenuItem = new JMenuItem(); scheduleMenu = new JMenu(); manageSchedulesMenuItem = new JMenuItem(); seperatorPanel = new JPanel(); separator1 = new JSeparator(); scheduleMenuItemsPanel = new JPanel(); toolsmenu = new JMenu(); clearAccountsMenuItem = new JMenuItem(); resetIndexMenuItem = new JMenuItem(); visitProfileMenuItem = new JMenuItem(); checkProfileMenuItem = new JMenuItem(); editAutoWatchListMenuItem = new JMenuItem(); deleteInboxMenuItem = new JMenuItem(); openConsoleMenuItem = new JMenuItem(); visitVisitorsMenuItem = new JMenuItem(); hideVisitorsMenuItem = new JMenuItem(); mainPanel = new JPanel(); leftPanel = new JPanel(); usernamesCombo = new JComboBox(); buttonPanel = new JPanel(); loginButton = new JButton(); runButton = new JButton(); stopButton = new JButton(); activityPanel = new JPanel(); runPanel = new JPanel(); label8 = new JLabel(); resetRunButton = new JButton(); label9 = new JLabel(); runVisitsPanel = new JPanel(); visitsCompletedUI = new JLabel(); visitLimitUI = new JLabel(); label2 = new JLabel(); startTimeUI = new JLabel(); label10 = new JLabel(); elapsedUI = new JLabel(); label4 = new JLabel(); endTimeUI = new JLabel(); totalPanel = new JPanel(); label11 = new JLabel(); totalVisitsUI = new JLabel(); resetTotalButton = new JButton(); activeSchedulePanel = new JPanel(); schedulePanel1 = new JPanel(); scheduleName1Label = new JLabel(); label21 = new JLabel(); scheduleTime1Label = new JLabel(); schedulePanel2 = new JPanel(); scheduleName2Label = new JLabel(); label24 = new JLabel(); scheduleTime2Label = new JLabel(); schedulePanel3 = new JPanel(); scheduleName3Label = new JLabel(); label27 = new JLabel(); scheduleTime3Label = new JLabel(); schedulePanel4 = new JPanel(); scheduleName4Label = new JLabel(); label30 = new JLabel(); scheduleTime4Label = new JLabel(); rightPanel = new JPanel(); settingsHeadingPanel = new JPanel(); label1 = new JLabel(); editButton = new JButton(); autoHideLabel = new JLabel(); orientation = new JLabel(); radius = new JLabel(); age = new JLabel(); lastOnline = new JLabel(); orderBy = new JLabel(); watchPanel = new JPanel(); autoWatchButton = new JToggleButton(); lastCheckedContainer = new JPanel(); lastCheckedPanel = new JPanel(); lastCheckedLabel = new JLabel(); label5 = new JLabel(); nextCheckLabel = new JLabel(); watchListPanel = new JPanel(); watch1 = new JLabel(); watchStatus1 = new JLabel(); watch2 = new JLabel(); watchStatus2 = new JLabel(); watch3 = new JLabel(); watchStatus3 = new JLabel(); watch4 = new JLabel(); watchStatus4 = new JLabel(); watch5 = new JLabel(); watchStatus5 = new JLabel(); statusLineContainer = new JPanel(); statusLinePanel = new JPanel(); consoleOutputLabel = new JLabel(); nextVisitPanel = new JPanel(); label16 = new JLabel(); nextVisitLabel = new JLabel(); panel2 = new JPanel(); label3 = new JLabel(); visitorCountLabel = new JLabel(); //======== this ======== setTitle("OkcApp v4.1"); Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("[168dlu,default]:grow", "fill:207dlu:grow")); //======== panel1 ======== {// w w w . ja v a 2 s . com panel1.setPreferredSize(new Dimension(300, 328)); panel1.setName("panel1"); panel1.setMinimumSize(new Dimension(280, 284)); panel1.setMaximumSize(new Dimension(300, 330)); panel1.setBorder(new MatteBorder(1, 1, 1, 1, Color.black)); panel1.setLayout(new FormLayout("146dlu:grow", "fill:12dlu, fill:162dlu, fill:26dlu")); //======== menuBar ======== { menuBar.setName("menuBar"); menuBar.setPreferredSize(new Dimension(155, 10)); //======== fileMenu ======== { fileMenu.setText("File"); fileMenu.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); //---- quitMenuItem ---- quitMenuItem.setText("Quit"); quitMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); quitMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { quitMenuItemActionPerformed(e); } }); fileMenu.add(quitMenuItem); } menuBar.add(fileMenu); //======== accountsMenu ======== { accountsMenu.setText("Accounts"); accountsMenu.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); //---- manageAccountsMenuItem ---- manageAccountsMenuItem.setText("Manage Accounts"); manageAccountsMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); manageAccountsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { manageAccountsMenuItemActionPerformed(e); } }); accountsMenu.add(manageAccountsMenuItem); //---- addAccountMenuItem ---- addAccountMenuItem.setText("Add Account"); addAccountMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); addAccountMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { addAccountMenuItemActionPerformed(e); } }); accountsMenu.add(addAccountMenuItem); } menuBar.add(accountsMenu); //======== scheduleMenu ======== { scheduleMenu.setText("Schedule"); scheduleMenu.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); scheduleMenu.setName("scheduleMenu"); //---- manageSchedulesMenuItem ---- manageSchedulesMenuItem.setText("Manage Schedules"); manageSchedulesMenuItem.setName("manageSchedules"); manageSchedulesMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); manageSchedulesMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { manageSchedulesMenuItemActionPerformed(e); } }); scheduleMenu.add(manageSchedulesMenuItem); //======== seperatorPanel ======== { seperatorPanel.setBackground(Color.white); seperatorPanel.setName("seperatorPanel"); seperatorPanel.setLayout(new FormLayout("center:85dlu", "default")); //---- separator1 ---- separator1.setForeground(Color.black); separator1.setPreferredSize(new Dimension(150, 12)); separator1.setName("seperator1"); seperatorPanel.add(separator1, new CellConstraints(1, 1, 1, 1, CC.DEFAULT, CC.TOP, new Insets(0, 5, 0, 5))); } scheduleMenu.add(seperatorPanel); //======== scheduleMenuItemsPanel ======== { scheduleMenuItemsPanel.setName("scheduleMenuItemsPanel"); scheduleMenuItemsPanel.setLayout(new FormLayout("default", "default")); } scheduleMenu.add(scheduleMenuItemsPanel); } menuBar.add(scheduleMenu); //======== toolsmenu ======== { toolsmenu.setText("Tools"); toolsmenu.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); toolsmenu.setName("toolsMenu"); //---- clearAccountsMenuItem ---- clearAccountsMenuItem.setText("Clear Accounts"); clearAccountsMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); clearAccountsMenuItem.setName("clearAccounts"); clearAccountsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { clearAccountsMenuItemActionPerformed(e); } }); toolsmenu.add(clearAccountsMenuItem); //---- resetIndexMenuItem ---- resetIndexMenuItem.setText("Reset Index"); resetIndexMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); resetIndexMenuItem.setName("resetIndex"); resetIndexMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { resetIndexActionPerformed(e); } }); toolsmenu.add(resetIndexMenuItem); //---- visitProfileMenuItem ---- visitProfileMenuItem.setText("Visit Single Profile"); visitProfileMenuItem.setFont(visitProfileMenuItem.getFont() .deriveFont(visitProfileMenuItem.getFont().getSize() - 2f)); visitProfileMenuItem.setName("visitProfileMenuItem"); visitProfileMenuItem.setEnabled(false); visitProfileMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { visitProfileMenuItemActionPerformed(e); } }); toolsmenu.add(visitProfileMenuItem); //---- checkProfileMenuItem ---- checkProfileMenuItem.setText("Check Profile"); checkProfileMenuItem.setName("checkProfileMenuItem"); checkProfileMenuItem.setEnabled(false); checkProfileMenuItem.setFont(checkProfileMenuItem.getFont() .deriveFont(checkProfileMenuItem.getFont().getSize() - 2f)); checkProfileMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkProfileMenuItemActionPerformed(e); } }); toolsmenu.add(checkProfileMenuItem); //---- editAutoWatchListMenuItem ---- editAutoWatchListMenuItem.setText("Edit Auto-Watch List"); editAutoWatchListMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); editAutoWatchListMenuItem.setName("editAutoWatchList"); editAutoWatchListMenuItem.setEnabled(false); editAutoWatchListMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { editAutoWatchListMenuItemActionPerformed(e); } }); toolsmenu.add(editAutoWatchListMenuItem); //---- deleteInboxMenuItem ---- deleteInboxMenuItem.setText("Delete Inbox"); deleteInboxMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); deleteInboxMenuItem.setEnabled(false); deleteInboxMenuItem.setName("deleteInbox"); deleteInboxMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deleteInboxMenuItemActionPerformed(e); } }); toolsmenu.add(deleteInboxMenuItem); //---- openConsoleMenuItem ---- openConsoleMenuItem.setText("Console"); openConsoleMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); openConsoleMenuItem.setName("openConsole"); openConsoleMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openConsoleMenuItemActionPerformed(e); } }); toolsmenu.add(openConsoleMenuItem); //---- visitVisitorsMenuItem ---- visitVisitorsMenuItem.setText("Visit Visitors"); visitVisitorsMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); visitVisitorsMenuItem.setName("visitVisitors"); visitVisitorsMenuItem.setEnabled(false); visitVisitorsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { visitVisitorsMenuItemActionPerformed(e); } }); toolsmenu.add(visitVisitorsMenuItem); //---- hideVisitorsMenuItem ---- hideVisitorsMenuItem.setText("Hide Visitors"); hideVisitorsMenuItem.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); hideVisitorsMenuItem.setName("hideVisitors"); hideVisitorsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { hideNewVisitorsMenuItemActionPerformed(e); } }); toolsmenu.add(hideVisitorsMenuItem); } menuBar.add(toolsmenu); } panel1.add(menuBar, CC.xy(1, 1)); //======== mainPanel ======== { mainPanel.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); mainPanel.setPreferredSize(new Dimension(305, 355)); mainPanel.setName("mainPanel"); mainPanel.setMinimumSize(new Dimension(250, 276)); mainPanel.setLayout(new FormLayout("81dlu, $ugap, 123px", "166dlu:grow")); //======== leftPanel ======== { leftPanel.setPreferredSize(new Dimension(175, 325)); leftPanel.setBorder(null); leftPanel.setMinimumSize(new Dimension(150, 276)); leftPanel.setLayout( new FormLayout("min", "bottom:default, default, 2dlu, 76dlu, $lgap, default")); //---- usernamesCombo ---- usernamesCombo.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); usernamesCombo.setPreferredSize(new Dimension(120, 27)); usernamesCombo.setName("usernames"); usernamesCombo.setVisible(false); usernamesCombo.addPropertyChangeListener("visible", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent e) { usernamesComboPropertyChange(e); } }); usernamesCombo.addPopupMenuListener(new PopupMenuListener() { @Override public void popupMenuCanceled(PopupMenuEvent e) { } @Override public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { usernamesComboPopupMenuWillBecomeInvisible(e); } @Override public void popupMenuWillBecomeVisible(PopupMenuEvent e) { } }); leftPanel.add(usernamesCombo, CC.xy(1, 1)); //======== buttonPanel ======== { buttonPanel.setName("buttonPanel"); buttonPanel.setLayout(new FormLayout("30dlu, 28dlu, 24dlu", "default")); //---- loginButton ---- loginButton.setText("Login"); loginButton.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); loginButton.setPreferredSize(new Dimension(70, 25)); loginButton.setName("login"); loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { loginButtonActionPerformed(e); } }); buttonPanel.add(loginButton, CC.xy(1, 1, CC.LEFT, CC.DEFAULT)); //---- runButton ---- runButton.setText("Run"); runButton.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); runButton.setPreferredSize(new Dimension(70, 25)); runButton.setName("run"); runButton.setEnabled(false); runButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { runButtonActionPerformed(e); } }); runButton.addPropertyChangeListener("visible", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent e) { runButtonPropertyChange(e); } }); buttonPanel.add(runButton, CC.xy(2, 1, CC.LEFT, CC.DEFAULT)); //---- stopButton ---- stopButton.setText("Stop"); stopButton.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); stopButton.setName("stopButton"); stopButton.setForeground(Color.red); stopButton.setVisible(false); stopButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { stopButtonActionPerformed(e); } }); buttonPanel.add(stopButton, CC.xy(3, 1)); } leftPanel.add(buttonPanel, CC.xy(1, 2, CC.DEFAULT, CC.FILL)); //======== activityPanel ======== { activityPanel.setName("activityPanel"); activityPanel.setPreferredSize(new Dimension(117, 300)); activityPanel.setBorder(new MatteBorder(0, 0, 0, 0, Color.black)); activityPanel.setLayout(new FormLayout("76dlu", "top:60dlu, top:16dlu")); //======== runPanel ======== { runPanel.setName("runPanel"); runPanel.setPreferredSize(new Dimension(200, 130)); runPanel.setBorder(new MatteBorder(1, 0, 1, 0, Color.black)); runPanel.setLayout(new FormLayout("34dlu, 25dlu:grow", "3dlu, 10dlu, $lgap, min, 3*($lgap, default)")); //---- label8 ---- label8.setText("Current"); label8.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); runPanel.add(label8, new CellConstraints(1, 2, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 2, 0, 0))); //---- resetRunButton ---- resetRunButton.setText("Reset"); resetRunButton.setPreferredSize(new Dimension(50, 15)); resetRunButton.setFont(new Font("Lucida Grande", Font.PLAIN, 9)); resetRunButton.setName("resetRun"); resetRunButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { resetRunButtonActionPerformed(e); } }); runPanel.add(resetRunButton, CC.xy(2, 2, CC.LEFT, CC.TOP)); //---- label9 ---- label9.setText("- Visits"); label9.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); runPanel.add(label9, new CellConstraints(1, 4, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 10, 0, 0))); //======== runVisitsPanel ======== { runVisitsPanel.setName("runVisitsPanel"); runVisitsPanel.setLayout(new FormLayout("default, $lcgap, 25dlu", "default")); //---- visitsCompletedUI ---- visitsCompletedUI.setText("0"); visitsCompletedUI.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); visitsCompletedUI.setName("visitsCompleted"); visitsCompletedUI.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent e) { visitsCompletedUIPropertyChange(e); } }); runVisitsPanel.add(visitsCompletedUI, CC.xy(1, 1)); //---- visitLimitUI ---- visitLimitUI.setText("of 0"); visitLimitUI.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); visitLimitUI.setName("visitLimitUI"); runVisitsPanel.add(visitLimitUI, CC.xy(3, 1)); } runPanel.add(runVisitsPanel, CC.xy(2, 4)); //---- label2 ---- label2.setText("- Start"); label2.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); runPanel.add(label2, new CellConstraints(1, 6, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 10, 0, 0))); //---- startTimeUI ---- startTimeUI.setText("00:00"); startTimeUI.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); startTimeUI.setName("start_time"); runPanel.add(startTimeUI, CC.xy(2, 6)); //---- label10 ---- label10.setText("- Elapsed"); label10.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); runPanel.add(label10, new CellConstraints(1, 8, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 10, 0, 0))); //---- elapsedUI ---- elapsedUI.setText("00:00:00"); elapsedUI.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); elapsedUI.setName("elapsed"); runPanel.add(elapsedUI, CC.xy(2, 8)); //---- label4 ---- label4.setText("- End"); label4.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); runPanel.add(label4, new CellConstraints(1, 10, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 10, 0, 0))); //---- endTimeUI ---- endTimeUI.setText("00:00 PM"); endTimeUI.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); endTimeUI.setName("end_time"); runPanel.add(endTimeUI, CC.xy(2, 10)); } activityPanel.add(runPanel, CC.xy(1, 1, CC.DEFAULT, CC.CENTER)); //======== totalPanel ======== { totalPanel.setName("totalPanel"); totalPanel.setPreferredSize(new Dimension(200, 60)); totalPanel.setBorder(new MatteBorder(0, 0, 1, 0, Color.black)); totalPanel.setLayout(new FormLayout("33dlu, min, 3dlu, 21dlu", "10dlu")); //---- label11 ---- label11.setText("Total Visits:"); label11.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); totalPanel.add(label11, new CellConstraints(1, 1, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 2, 0, 0))); //---- totalVisitsUI ---- totalVisitsUI.setText("0"); totalVisitsUI.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); totalVisitsUI.setName("totalVisits"); totalPanel.add(totalVisitsUI, CC.xy(2, 1, CC.FILL, CC.DEFAULT)); //---- resetTotalButton ---- resetTotalButton.setText("Reset"); resetTotalButton.setFont(new Font("Lucida Grande", Font.PLAIN, 9)); resetTotalButton.setPreferredSize(new Dimension(50, 15)); resetTotalButton.setName("resetTotal"); resetTotalButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { resetTotalButtonActionPerformed(e); } }); totalPanel.add(resetTotalButton, CC.xy(4, 1, CC.LEFT, CC.DEFAULT)); } activityPanel.add(totalPanel, new CellConstraints(1, 2, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(5, 0, 0, 0))); } leftPanel.add(activityPanel, new CellConstraints(1, 4, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 10, 0, 0))); //======== activeSchedulePanel ======== { activeSchedulePanel.setName("activeSchedulePanel2"); activeSchedulePanel .setLayout(new FormLayout("default:grow", "3*(default, $lgap), default")); //======== schedulePanel1 ======== { schedulePanel1.setName("schedulePanel1"); schedulePanel1.setVisible(false); schedulePanel1.setLayout(new FormLayout("2*(default, $lcgap), default", "default")); //---- scheduleName1Label ---- scheduleName1Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleName1Label.setName("scheduleName1Label"); schedulePanel1.add(scheduleName1Label, CC.xy(1, 1)); //---- label21 ---- label21.setText("-"); label21.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); schedulePanel1.add(label21, CC.xy(3, 1, CC.CENTER, CC.DEFAULT)); //---- scheduleTime1Label ---- scheduleTime1Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleTime1Label.setName("scheduleTime1Label"); schedulePanel1.add(scheduleTime1Label, CC.xy(5, 1)); } activeSchedulePanel.add(schedulePanel1, CC.xy(1, 1)); //======== schedulePanel2 ======== { schedulePanel2.setName("schedulePanel2"); schedulePanel2.setVisible(false); schedulePanel2.setLayout(new FormLayout("2*(default, $lcgap), default", "default")); //---- scheduleName2Label ---- scheduleName2Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleName2Label.setName("scheduleName2Label"); schedulePanel2.add(scheduleName2Label, CC.xy(1, 1)); //---- label24 ---- label24.setText("-"); label24.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); schedulePanel2.add(label24, CC.xy(3, 1, CC.CENTER, CC.DEFAULT)); //---- scheduleTime2Label ---- scheduleTime2Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleTime2Label.setName("scheduleTime2Label"); schedulePanel2.add(scheduleTime2Label, CC.xy(5, 1)); } activeSchedulePanel.add(schedulePanel2, CC.xy(1, 3)); //======== schedulePanel3 ======== { schedulePanel3.setName("schedulePanel3"); schedulePanel3.setVisible(false); schedulePanel3.setLayout(new FormLayout("2*(default, $lcgap), default", "default")); //---- scheduleName3Label ---- scheduleName3Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleName3Label.setName("scheduleName3Label"); schedulePanel3.add(scheduleName3Label, CC.xy(1, 1)); //---- label27 ---- label27.setText("-"); label27.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); schedulePanel3.add(label27, CC.xy(3, 1, CC.CENTER, CC.DEFAULT)); //---- scheduleTime3Label ---- scheduleTime3Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleTime3Label.setName("scheduleTime3Label"); schedulePanel3.add(scheduleTime3Label, CC.xy(5, 1)); } activeSchedulePanel.add(schedulePanel3, CC.xy(1, 5)); //======== schedulePanel4 ======== { schedulePanel4.setName("schedulePanel4"); schedulePanel4.setVisible(false); schedulePanel4.setLayout(new FormLayout("2*(default, $lcgap), default", "default")); //---- scheduleName4Label ---- scheduleName4Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleName4Label.setName("scheduleName4Label"); schedulePanel4.add(scheduleName4Label, CC.xy(1, 1)); //---- label30 ---- label30.setText("-"); label30.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); schedulePanel4.add(label30, CC.xy(3, 1, CC.CENTER, CC.DEFAULT)); //---- scheduleTime4Label ---- scheduleTime4Label.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); scheduleTime4Label.setName("scheduleTime4Label"); schedulePanel4.add(scheduleTime4Label, CC.xy(5, 1)); } activeSchedulePanel.add(schedulePanel4, CC.xy(1, 7)); } leftPanel.add(activeSchedulePanel, new CellConstraints(1, 6, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 10, 0, 0))); } mainPanel.add(leftPanel, CC.xy(1, 1, CC.FILL, CC.TOP)); //======== rightPanel ======== { rightPanel.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); rightPanel.setPreferredSize(new Dimension(180, 250)); rightPanel.setMinimumSize(new Dimension(121, 276)); rightPanel.setLayout(new FormLayout("73dlu", "7*(default, $lgap), default")); //======== settingsHeadingPanel ======== { settingsHeadingPanel.setName("settingsheadingPanel"); settingsHeadingPanel.setLayout(new FormLayout("default, $lcgap, 28dlu", "22dlu")); //---- label1 ---- label1.setText("Settings"); label1.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); settingsHeadingPanel.add(label1, CC.xy(1, 1)); //---- editButton ---- editButton.setText("Edit"); editButton.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); editButton.setEnabled(false); editButton.setPreferredSize(new Dimension(70, 25)); editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { editButtonActionPerformed(e); } }); settingsHeadingPanel.add(editButton, CC.xy(3, 1)); } rightPanel.add(settingsHeadingPanel, CC.xy(1, 1)); //---- autoHideLabel ---- autoHideLabel.setText("- Auto-hide:"); autoHideLabel.setFont(new Font("Lucida Grande", Font.ITALIC, 10)); autoHideLabel.setName("autoHideLabel"); rightPanel.add(autoHideLabel, CC.xy(1, 3)); //---- orientation ---- orientation.setText("- orientation"); orientation.setFont(new Font("Lucida Grande", Font.ITALIC, 10)); orientation.setName("orientationSet"); rightPanel.add(orientation, CC.xy(1, 5)); //---- radius ---- radius.setText("- search radius"); radius.setFont(new Font("Lucida Grande", Font.ITALIC, 10)); radius.setName("radiusSet"); rightPanel.add(radius, CC.xy(1, 7)); //---- age ---- age.setText("- age"); age.setFont(new Font("Lucida Grande", Font.ITALIC, 10)); age.setName("ageSet"); rightPanel.add(age, CC.xy(1, 9)); //---- lastOnline ---- lastOnline.setText("- last online"); lastOnline.setFont(new Font("Lucida Grande", Font.ITALIC, 10)); lastOnline.setName("lastOnlineSet"); rightPanel.add(lastOnline, CC.xy(1, 11)); //---- orderBy ---- orderBy.setText("- sort order"); orderBy.setFont(new Font("Lucida Grande", Font.ITALIC, 10)); orderBy.setName("orderBySet"); rightPanel.add(orderBy, CC.xy(1, 13)); //======== watchPanel ======== { watchPanel.setName("watchPanel"); watchPanel.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watchPanel.setLayout(new FormLayout("72dlu:grow", "15dlu, $lgap, 10dlu, 82dlu")); //---- autoWatchButton ---- autoWatchButton.setText("Auto-Watch"); autoWatchButton.setPreferredSize(new Dimension(85, 29)); autoWatchButton.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); autoWatchButton.setName("autoWatch"); autoWatchButton.setEnabled(false); autoWatchButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { autoWatchButtonActionPerformed(e); } }); watchPanel.add(autoWatchButton, new CellConstraints(1, 1, 1, 1, CC.LEFT, CC.DEFAULT, new Insets(0, -5, 0, 0))); //======== lastCheckedContainer ======== { lastCheckedContainer.setName("lastCheckedContainer"); lastCheckedContainer.setLayout(new FormLayout("71dlu", "default")); //======== lastCheckedPanel ======== { lastCheckedPanel.setName("lastCheckedPanel"); lastCheckedPanel .setLayout(new FormLayout("left:25dlu, center:10dlu, left:18dlu", "10dlu")); //---- lastCheckedLabel ---- lastCheckedLabel.setName("lastChecked"); lastCheckedLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); lastCheckedLabel.setText("00:00 AM"); lastCheckedLabel.setBorder(null); lastCheckedPanel.add(lastCheckedLabel, CC.xy(1, 1, CC.RIGHT, CC.DEFAULT)); //---- label5 ---- label5.setText(" / "); label5.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); lastCheckedPanel.add(label5, CC.xy(2, 1)); //---- nextCheckLabel ---- nextCheckLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); nextCheckLabel.setName("nextCheckLabel"); nextCheckLabel.setBorder(null); lastCheckedPanel.add(nextCheckLabel, CC.xy(3, 1)); } lastCheckedContainer.add(lastCheckedPanel, new CellConstraints(1, 1, 1, 1, CC.LEFT, CC.DEFAULT, new Insets(0, 2, 0, 0))); } watchPanel.add(lastCheckedContainer, CC.xy(1, 3)); //======== watchListPanel ======== { watchListPanel.setLayout( new FormLayout("50dlu, 3dlu, 29dlu:grow", "4*(default, $lgap), default")); //---- watch1 ---- watch1.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watch1.setName("watch1"); watch1.setVisible(false); watchListPanel.add(watch1, CC.xy(1, 1)); //---- watchStatus1 ---- watchStatus1.setText("-"); watchStatus1.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watchStatus1.setName("watchStatus1"); watchStatus1.setVisible(false); watchListPanel.add(watchStatus1, CC.xy(3, 1, CC.LEFT, CC.DEFAULT)); //---- watch2 ---- watch2.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watch2.setName("watch2"); watch2.setVisible(false); watchListPanel.add(watch2, CC.xy(1, 3)); //---- watchStatus2 ---- watchStatus2.setText("-"); watchStatus2.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watchStatus2.setName("watchStatus2"); watchStatus2.setVisible(false); watchListPanel.add(watchStatus2, CC.xy(3, 3, CC.LEFT, CC.DEFAULT)); //---- watch3 ---- watch3.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watch3.setName("watch3"); watch3.setVisible(false); watchListPanel.add(watch3, CC.xy(1, 5)); //---- watchStatus3 ---- watchStatus3.setText("-"); watchStatus3.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watchStatus3.setName("watchStatus3"); watchStatus3.setVisible(false); watchListPanel.add(watchStatus3, CC.xy(3, 5, CC.LEFT, CC.DEFAULT)); //---- watch4 ---- watch4.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watch4.setName("watch4"); watch4.setVisible(false); watchListPanel.add(watch4, CC.xy(1, 7)); //---- watchStatus4 ---- watchStatus4.setText("-"); watchStatus4.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watchStatus4.setName("watchStatus4"); watchStatus4.setVisible(false); watchListPanel.add(watchStatus4, CC.xy(3, 7, CC.LEFT, CC.DEFAULT)); //---- watch5 ---- watch5.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watch5.setName("watch5"); watch5.setVisible(false); watchListPanel.add(watch5, CC.xy(1, 9)); //---- watchStatus5 ---- watchStatus5.setText("-"); watchStatus5.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); watchStatus5.setName("watchStatus5"); watchStatus5.setVisible(false); watchListPanel.add(watchStatus5, CC.xy(3, 9, CC.LEFT, CC.DEFAULT)); } watchPanel.add(watchListPanel, new CellConstraints(1, 4, 1, 1, CC.DEFAULT, CC.TOP, new Insets(5, 4, 0, 0))); } rightPanel.add(watchPanel, CC.xy(1, 15)); } mainPanel.add(rightPanel, CC.xy(3, 1, CC.DEFAULT, CC.TOP)); } panel1.add(mainPanel, new CellConstraints(1, 2, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(5, 5, 0, 0))); //======== statusLineContainer ======== { statusLineContainer.setName("statusLineContainer"); statusLineContainer.setBorder(new MatteBorder(1, 0, 0, 0, Color.black)); statusLineContainer.setBackground(new Color(204, 204, 204)); statusLineContainer.setPreferredSize(new Dimension(277, 60)); statusLineContainer.setLayout(new FormLayout("144dlu:grow", "top:33dlu")); //======== statusLinePanel ======== { statusLinePanel.setName("statusLinePanel"); statusLinePanel.setBackground(new Color(204, 204, 204)); statusLinePanel.setLayout( new FormLayout("75dlu:grow, right:20dlu:grow", "bottom:default:grow, $nlgap, default")); //---- consoleOutputLabel ---- consoleOutputLabel.setText("Please log in."); consoleOutputLabel.setName("consoleOutput"); consoleOutputLabel.setFont(new Font("Lucida Grande", Font.ITALIC, 12)); statusLinePanel.add(consoleOutputLabel, new CellConstraints(1, 1, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 5, 0, 0))); //======== nextVisitPanel ======== { nextVisitPanel.setName("nextVisitPanel"); nextVisitPanel.setBackground(new Color(204, 204, 204)); nextVisitPanel.setLayout( new FormLayout("left:30dlu:grow, $rgap, left:14dlu", "bottom:default:grow")); //---- label16 ---- label16.setText("Next visit:"); label16.setName("nextVisit"); label16.setFont(new Font("Lucida Grande", Font.ITALIC, 12)); nextVisitPanel.add(label16, CC.xy(1, 1, CC.LEFT, CC.DEFAULT)); //---- nextVisitLabel ---- nextVisitLabel.setText("-"); nextVisitLabel.setName("nextVisit"); nextVisitPanel.add(nextVisitLabel, CC.xy(3, 1, CC.LEFT, CC.DEFAULT)); } statusLinePanel.add(nextVisitPanel, CC.xy(2, 1, CC.RIGHT, CC.DEFAULT)); //======== panel2 ======== { panel2.setBackground(new Color(204, 204, 204)); panel2.setLayout(new FormLayout("28dlu, $lcgap, center:11dlu:grow", "default")); //---- label3 ---- label3.setText("Visitors:"); label3.setFont(new Font("Lucida Grande", Font.ITALIC, 12)); panel2.add(label3, CC.xy(1, 1)); //---- visitorCountLabel ---- visitorCountLabel.setText("-"); visitorCountLabel.setName("visitorCount"); visitorCountLabel.setFont(new Font("Lucida Grande", Font.ITALIC, 12)); panel2.add(visitorCountLabel, CC.xy(3, 1, CC.LEFT, CC.DEFAULT)); } statusLinePanel.add(panel2, new CellConstraints(1, 3, 1, 1, CC.DEFAULT, CC.DEFAULT, new Insets(0, 5, 0, 0))); } statusLineContainer.add(statusLinePanel, CC.xy(1, 1)); } panel1.add(statusLineContainer, CC.xy(1, 3)); } contentPane.add(panel1, CC.xy(1, 1)); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:loginscreen.java
License:Open Source License
/** * Initialize the contents of the frame. *//*from w w w . j ava 2 s.co m*/ private void initialize() { frmXarena = new JFrame(); frmXarena.setExtendedState(frmXarena.getExtendedState() | JFrame.MAXIMIZED_BOTH); frmXarena.setTitle("X.ARENA"); frmXarena.getContentPane().setBackground(Color.BLACK); //frmXarena.setBounds(0, 0, 1366, 768); frmXarena.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frmXarena.getContentPane().setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("left:45px:grow"), ColumnSpec.decode("72px"), ColumnSpec.decode("25px"), ColumnSpec.decode("147px:grow"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, }, new RowSpec[] { RowSpec.decode("30px"), RowSpec.decode("15px"), RowSpec.decode("35px"), RowSpec.decode("19px"), RowSpec.decode("35px"), RowSpec.decode("19px"), RowSpec.decode("35px"), RowSpec.decode("25px"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), })); JLabel lblXarena = new JLabel("X.ARENA"); lblXarena.setFont(new Font("Dialog", Font.BOLD, 17)); lblXarena.setForeground(Color.RED); frmXarena.getContentPane().add(lblXarena, "4, 2, center, center"); JLabel lblUsername = new JLabel("Username"); lblUsername.setForeground(Color.GREEN); frmXarena.getContentPane().add(lblUsername, "2, 4, center, center"); usernameTextField = new JTextField(); frmXarena.getContentPane().add(usernameTextField, "4, 4, fill, center"); usernameTextField.setColumns(10); JLabel lblPassword = new JLabel("Password"); lblPassword.setForeground(Color.GREEN); frmXarena.getContentPane().add(lblPassword, "2, 6, center, center"); passwordTextField = new JPasswordField(); frmXarena.getContentPane().add(passwordTextField, "4, 6, fill, center"); JButton btnLogin = new JButton("Login"); btnLogin.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { SocketClient client = new SocketClient(); if (client.main(null) == CONNECTION_ESTABILISHED) { String username, loginDetails; char[] password; username = usernameTextField.getText(); password = passwordTextField.getPassword(); loginDetails = "LOGIN" + (char) 13 + username + (char) 13 + (new String(password)) + (char) 13; if (client.sendLoginDetails(loginDetails) == 1) { JOptionPane.showMessageDialog(frmXarena, "Login successfull!"); mainscreen screen = new mainscreen(); window.frmXarena.setVisible(false); screen.main(null); System.out.println("here after calling main"); } else { JOptionPane.showMessageDialog(frmXarena, "Login failed"); } } } }); frmXarena.getContentPane().add(btnLogin, "4, 8, center, center"); JButton btnSignUp = new JButton("Sign Up"); btnSignUp.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { signupscreen sus = new signupscreen(); sus.main(null); window.frmXarena.setVisible(false); } }); frmXarena.getContentPane().add(btnSignUp, "4, 10, center, center"); JTextArea txtrCreatedByAshish = new JTextArea(); txtrCreatedByAshish.setText( " /******************************************************************\n\nFrom the creators of the X BUS RESERVATION SYSTEM\n\nDeveloped using Git as the Version Control System.\nFind the repository at www.github.com/ashmew2/xarena\n\t\n\t====================\n\t WELCOME TO X.ARENA\n\t====================\n\nX.Arena is a platform for programmers who enjoy programming.\n\nThe currently supported languages are GNU C and C++.\n\nThis is copyright software licensed under GNU Public License v2.\nYou can view the full license at www.gnu.org/licences.\n\n\n*******************************************************************/\n"); txtrCreatedByAshish.setForeground(Color.RED); txtrCreatedByAshish.setBackground(Color.BLACK); frmXarena.getContentPane().add(txtrCreatedByAshish, "4, 28, center, fill"); }
From source file:ClientConnectionGUI.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Austin Seber clientConnectionGUI = new JPanel(); contentPanel = new JPanel(); serverAddressTextField = new JTextField(); serverNameTextField = new JTextField(); serverPortTextField = new JTextField(); saveServerInformationCheckButton = new JCheckBox(); buttonBar = new JPanel(); notificationTextField = new JTextField(); connectButton = new JButton(); cancelButton = new JButton(); //======== this ======== setTitle("Connect to a server"); setResizable(false);/*from w w w.j a v a 2s .co m*/ Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== clientConnectionGUI ======== { clientConnectionGUI.setBorder(Borders.DIALOG_BORDER); clientConnectionGUI.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout("135dlu, $lcgap, 106dlu", "2*(default, $lgap), default")); //---- serverAddressTextField ---- serverAddressTextField.setBorder(new TitledBorder(null, "Server address", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, null, Color.black)); serverAddressTextField.setBackground(new Color(240, 240, 240)); serverAddressTextField.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); serverAddressTextField.setText("localhost"); contentPanel.add(serverAddressTextField, CC.xywh(1, 1, 3, 1)); serverAddressTextField.addKeyListener(new KeyListener() { @Override public void keyPressed(KeyEvent key) { if (key.getKeyCode() == KeyEvent.VK_ENTER) { connectButtonMouseClicked(); } if (key.getKeyCode() == KeyEvent.VK_ESCAPE) { cancelButtonMouseClicked(); } } @Override public void keyReleased(KeyEvent e) { } @Override public void keyTyped(KeyEvent e) { } }); //---- serverNameTextField ---- serverNameTextField.setBorder(new TitledBorder(null, "Server name", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, null, Color.black)); serverNameTextField.setBackground(new Color(240, 240, 240)); serverNameTextField.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); contentPanel.add(serverNameTextField, CC.xy(1, 3)); //---- serverPortTextField ---- serverPortTextField.setBorder(new TitledBorder(null, "Server port", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, null, Color.black)); serverPortTextField.setBackground(new Color(240, 240, 240)); serverPortTextField.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); serverPortTextField.setText("25566"); contentPanel.add(serverPortTextField, CC.xy(3, 3)); serverPortTextField.addKeyListener(new KeyListener() { @Override public void keyPressed(KeyEvent key) { if (key.getKeyCode() == KeyEvent.VK_ENTER) { connectButtonMouseClicked(); } if (key.getKeyCode() == KeyEvent.VK_ESCAPE) { cancelButtonMouseClicked(); } } @Override public void keyReleased(KeyEvent e) { } @Override public void keyTyped(KeyEvent e) { } }); //---- saveServerInformationCheckButton ---- saveServerInformationCheckButton.setText("Save server information"); saveServerInformationCheckButton.setBorder(new LineBorder(new Color(0, 0, 0, 0), 2)); contentPanel.add(saveServerInformationCheckButton, CC.xy(3, 5)); } clientConnectionGUI.add(contentPanel, BorderLayout.WEST); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout("$lcgap, 133dlu, $lcgap, $button, $rgap, $button", "pref")); //---- notificationTextField ---- notificationTextField.setBorder(new LineBorder(new Color(0, 0, 0, 0), 2)); notificationTextField.setBackground(new Color(240, 240, 240)); notificationTextField.setEditable(false); buttonBar.add(notificationTextField, CC.xy(2, 1)); //---- connectButton ---- connectButton.setText("Connect"); connectButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { connectButtonMouseClicked(); } }); buttonBar.add(connectButton, CC.xy(4, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { cancelButtonMouseClicked(); } }); buttonBar.add(cancelButton, CC.xy(6, 1)); } clientConnectionGUI.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(clientConnectionGUI, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents serverNameTextField.setEnabled(false); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); connectButton.setFocusable(false); //connectButton.setMnemonic(KeyEvent.VK_ENTER); //Make the enter key connect to the server as if you were pressing it. cancelButton.setFocusable(false); //cancelButton.setMnemonic(KeyEvent.VK_ESCAPE); //Make the escape key quit from the menu as if you were pressing it. }
From source file:InformationDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("InformationDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); iconLabel = new JLabel(); pathLabel = new JLabel(); JLabel labelFrom = new JLabel(); fieldFrom = new JTextField(); JLabel labelSize = new JLabel(); fieldSize = new JTextField(); JLabel labelDescription = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); descriptionArea = ComponentFactory.getTextArea(); JPanel optionsPanel = new JPanel(); JLabel saveToLabel = new JLabel(); comboPath = new JComboBox(); btnSelectPath = new JButton(); progressBar = new JProgressBar(); JLabel labelRemaining = new JLabel(); remainingLabel = new JLabel(); JLabel labelEstimateTime = new JLabel(); estTimeLabel = new JLabel(); JLabel labelCurrentSpeed = new JLabel(); currentSpeedLabel = new JLabel(); JLabel labelAverageSpeed = new JLabel(); avgSpeedLabel = new JLabel(); JXButtonPanel buttonBar = new JXButtonPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*w ww . jav a 2 s . c o m*/ dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //---- iconLabel ---- iconLabel.setText(bundle.getString("iconLabel.text")); //---- pathLabel ---- pathLabel.setText(bundle.getString("pathLabel.text")); pathLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelFrom ---- labelFrom.setText(bundle.getString("labelFrom.text")); //---- fieldFrom ---- fieldFrom.setBorder(null); fieldFrom.setOpaque(false); fieldFrom.setText(bundle.getString("fieldFrom.text")); //---- labelSize ---- labelSize.setText(bundle.getString("labelSize.text")); //---- fieldSize ---- fieldSize.setBorder(null); fieldSize.setOpaque(false); //---- labelDescription ---- labelDescription.setText(bundle.getString("labelDescription.text")); //======== scrollPane1 ======== { scrollPane1.setViewportView(descriptionArea); } //======== optionsPanel ======== { //---- saveToLabel ---- saveToLabel.setText(bundle.getString("saveToLabel.text")); saveToLabel.setLabelFor(comboPath); //---- comboPath ---- comboPath.setEditable(true); //---- btnSelectPath ---- btnSelectPath.setText(bundle.getString("btnSelectPath.text")); PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default")), optionsPanel); optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1)); optionsPanelBuilder.add(comboPath, cc.xy(3, 1)); optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1)); } //---- progressBar ---- progressBar.setFont(new Font("Tahoma", Font.BOLD, 16)); //---- labelRemaining ---- labelRemaining.setText(bundle.getString("labelRemaining.text")); //---- remainingLabel ---- remainingLabel.setText(bundle.getString("remainingLabel.text")); remainingLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelEstimateTime ---- labelEstimateTime.setText(bundle.getString("labelEstimateTime.text")); //---- estTimeLabel ---- estTimeLabel.setText(bundle.getString("estTimeLabel.text")); estTimeLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelCurrentSpeed ---- labelCurrentSpeed.setText(bundle.getString("labelCurrentSpeed.text")); //---- currentSpeedLabel ---- currentSpeedLabel.setText(bundle.getString("currentSpeedLabel.text")); currentSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelAverageSpeed ---- labelAverageSpeed.setText(bundle.getString("labelAverageSpeed.text")); //---- avgSpeedLabel ---- avgSpeedLabel.setText(bundle.getString("avgSpeedLabel.text")); avgSpeedLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); PanelBuilder contentPanelBuilder = new PanelBuilder( new FormLayout(new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)), FormSpec.DEFAULT_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("fill:max(pref;20dlu)"), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), contentPanel); contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5)); contentPanelBuilder.add(pathLabel, cc.xywh(3, 1, 7, 1)); contentPanelBuilder.add(labelFrom, cc.xy(3, 3)); contentPanelBuilder.add(fieldFrom, cc.xywh(5, 3, 5, 1)); contentPanelBuilder.add(labelSize, cc.xy(3, 5)); contentPanelBuilder.add(fieldSize, cc.xywh(5, 5, 3, 1)); contentPanelBuilder.add(labelDescription, cc.xy(1, 7)); contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 9, 1)); contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 9, 1)); contentPanelBuilder.add(progressBar, cc.xywh(1, 13, 9, 1)); contentPanelBuilder.add(labelRemaining, cc.xy(1, 15)); contentPanelBuilder.add(remainingLabel, cc.xywh(3, 15, 3, 1)); contentPanelBuilder.add(labelEstimateTime, cc.xy(7, 15)); contentPanelBuilder.add(estTimeLabel, cc.xy(9, 15)); contentPanelBuilder.add(labelCurrentSpeed, cc.xy(1, 17)); contentPanelBuilder.add(currentSpeedLabel, cc.xywh(3, 17, 3, 1)); contentPanelBuilder.add(labelAverageSpeed, cc.xy(7, 17)); contentPanelBuilder.add(avgSpeedLabel, cc.xy(9, 17)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); //---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } }); buttonBarBuilder.add(okButton, cc.xy(3, 1)); buttonBarBuilder.add(cancelButton, cc.xy(5, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:JPFamiliaGenerico.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown lblCodigo = new JLabel(); txtCodigo = new JTextField(); lblNombre = new JLabel(); txtNombre = new JTextField(); spTblFamiliaGenerico = new JScrollPane(); tblFamiliaGenerico = new JTable(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(50)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(150)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.dluX(60), FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- lblCodigo ---- lblCodigo.setText("C\u00f3digo:"); lblCodigo.setHorizontalAlignment(SwingConstants.RIGHT); add(lblCodigo, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL)); add(txtCodigo, cc.xywh(5, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); //---- lblNombre ---- lblNombre.setText("Nombre:"); lblNombre.setHorizontalAlignment(SwingConstants.RIGHT); add(lblNombre, cc.xywh(3, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL)); add(txtNombre, cc.xywh(5, 5, 3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); //======== spTblFamiliaGenerico ======== {/* w w w.ja va 2 s. c o m*/ //---- tblFamiliaGenerico ---- tblFamiliaGenerico .setModel(new DefaultTableModel(new Object[][] {}, new String[] { "C\u00f3digo", "Nombre" }) { boolean[] columnEditable = new boolean[] { false, false }; @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return columnEditable[columnIndex]; } }); spTblFamiliaGenerico.setViewportView(tblFamiliaGenerico); } add(spTblFamiliaGenerico, cc.xywh(3, 9, 7, 5)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:Frame1.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Andrei Branga button1 = new JButton(); textField1 = new JTextField(); label1 = new JLabel(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("8*(default, $lcgap), default", "3*(default, $lgap), default")); //---- button1 ---- button1.setText("text"); button1.addMouseListener(new MouseAdapter() { @Override//from w w w . jav a 2s . c om public void mouseClicked(MouseEvent e) { button1MouseClicked(e); } }); contentPane.add(button1, CC.xywh(1, 3, 3, 1)); contentPane.add(textField1, CC.xywh(6, 3, 12, 1)); //---- label1 ---- label1.setText("text"); contentPane.add(label1, CC.xywh(3, 7, 9, 1)); pack(); setLocationRelativeTo(getOwner()); //---- bindings ---- bindingGroup = new BindingGroup(); bindingGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, button1, button1, BeanProperty.create("selected"))); bindingGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, textField1, textField1, BeanProperty.create("text"))); bindingGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE, label1, label1, BeanProperty.create("labelFor"))); bindingGroup.bind(); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:Question_4.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Hua Zhang frame1 = new JFrame(); panel1 = new JPanel(); //======== frame1 ======== {/*w ww . j av a 2 s .co m*/ Container frame1ContentPane = frame1.getContentPane(); frame1ContentPane.setLayout(new GridLayout()); //======== panel1 ======== { // JFormDesigner evaluation mark panel1.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), panel1.getBorder())); panel1.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); panel1.setLayout(new FormLayout("default, $lcgap, default", "2*(default, $lgap), default")); } frame1ContentPane.add(panel1); frame1.pack(); frame1.setLocationRelativeTo(frame1.getOwner()); } // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:MultipleSettingsDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("MultipleSettingsDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JLabel iconLabel = new JLabel(); titleLabel = new JLabel(); JLabel labelSize = new JLabel(); fieldSize = new JTextField(); JLabel labelDescription = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); descriptionArea = ComponentFactory.getTextArea(); JPanel optionsPanel = new JPanel(); JLabel saveToLabel = new JLabel(); comboPath = new JComboBox(); btnSelectPath = new JButton(); JXButtonPanel buttonBar = new JXButtonPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//from w w w . j av a 2 s . c o m dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //---- iconLabel ---- iconLabel.setText(bundle.getString("iconLabel.text")); //---- titleLabel ---- titleLabel.setText(bundle.getString("titleLabel.text")); titleLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelSize ---- labelSize.setText(bundle.getString("labelSize.text")); //---- fieldSize ---- fieldSize.setBorder(null); fieldSize.setOpaque(false); fieldSize.setEditable(false); //---- labelDescription ---- labelDescription.setText(bundle.getString("labelDescription.text")); //======== scrollPane1 ======== { scrollPane1.setViewportView(descriptionArea); } //======== optionsPanel ======== { //---- saveToLabel ---- saveToLabel.setText(bundle.getString("saveToLabel.text")); saveToLabel.setLabelFor(comboPath); //---- comboPath ---- comboPath.setEditable(true); //---- btnSelectPath ---- btnSelectPath.setText(bundle.getString("btnSelectPath.text")); PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default")), optionsPanel); optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1)); optionsPanelBuilder.add(comboPath, cc.xy(3, 1)); optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1)); } PanelBuilder contentPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.TOP, Sizes.PREFERRED, FormSpec.NO_GROW), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)), FormSpec.DEFAULT_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), contentPanel); contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5, CellConstraints.DEFAULT, CellConstraints.FILL)); contentPanelBuilder.add(titleLabel, cc.xywh(3, 1, 5, 1)); contentPanelBuilder.add(labelSize, cc.xy(3, 3)); contentPanelBuilder.add(fieldSize, cc.xywh(5, 3, 3, 1)); contentPanelBuilder.add(labelDescription, cc.xy(1, 7)); contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 7, 1)); contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 7, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); //---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } }); buttonBarBuilder.add(okButton, cc.xy(3, 1)); buttonBarBuilder.add(cancelButton, cc.xy(5, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:homeScreenFront.java
private void initComponents() { // Generated using JFormDesigner Evaluation license - Artion Fine label1 = new JLabel(); button1 = new JButton(); button2 = new JButton(); button3 = new JButton(); //======== this ======== // JFormDesigner evaluation mark setBorder(/* www . j a v a2s .c o m*/ new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); setLayout(new FormLayout("4*(default, $lcgap), 44dlu, $lcgap, default", "11*(default, $lgap), default")); //---- label1 ---- label1.setText("Description Goes Here"); add(label1, CC.xywh(3, 3, 9, 13)); //---- button1 ---- button1.setText("Trips"); add(button1, CC.xywh(3, 17, 5, 5)); //---- button2 ---- button2.setText("Profile"); add(button2, CC.xywh(9, 17, 1, 5)); //---- button3 ---- button3.setText("Exit"); button3.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { exitButtonListener(e); exitButtonListener(e); } }); add(button3, CC.xywh(11, 17, 1, 5)); // JFormDesigner - End of component initialization //GEN-END:initComponents }