List of usage examples for javax.swing GroupLayout PREFERRED_SIZE
int PREFERRED_SIZE
To view the source code for javax.swing GroupLayout PREFERRED_SIZE.
Click Source Link
From source file:dictionary.GUI.GUI_Main.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from w ww. j a v a2 s . co m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { frameMean = new javax.swing.JFrame(); jScrollPane1 = new javax.swing.JScrollPane(); fieldMean = new javax.swing.JEditorPane(); buttonEdit = new javax.swing.JButton(); buttonSave = new javax.swing.JButton(); buttonDelete = new javax.swing.JButton(); buttonExit = new javax.swing.JButton(); frameEntries = new javax.swing.JFrame(); jScrollPane3 = new javax.swing.JScrollPane(); listEntries = new javax.swing.JList(); frameAdd = new javax.swing.JFrame(); fieldAddWord = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); fieldAddMean = new javax.swing.JEditorPane(); buttonAdd2 = new javax.swing.JButton(); labelWord = new javax.swing.JLabel(); buttonCloseAdd = new javax.swing.JButton(); frameSetting = new javax.swing.JFrame(); panelVoice = new javax.swing.JPanel(); button1 = new javax.swing.JRadioButton(); button2 = new javax.swing.JRadioButton(); buttonCloseSetting = new javax.swing.JButton(); buttonAboutUs = new javax.swing.JButton(); buttonGroup1 = new javax.swing.ButtonGroup(); frameCo = new javax.swing.JFrame(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); main = new javax.swing.JPanel(); comboBoxEV = new javax.swing.JComboBox(); fieldWord = new javax.swing.JTextField(); labelDic = new javax.swing.JLabel(); labelAuthor = new javax.swing.JLabel(); buttonAdd = new javax.swing.JButton(); buttonSetting = new javax.swing.JButton(); traonl = new javax.swing.JButton(); comboBoxOnl = new javax.swing.JComboBox(); buttonSpeech = new javax.swing.JButton(); buttonUndo = new javax.swing.JButton(); buttonFind = new javax.swing.JButton(); frameMean.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); frameMean.setTitle("Mean"); frameMean.setLocation(new java.awt.Point(780, 0)); frameMean.setName("frameMean"); // NOI18N frameMean.setUndecorated(true); frameMean.setSize(new java.awt.Dimension(500, 400)); fieldMean.setEditable(false); fieldMean.setBackground(new java.awt.Color(204, 255, 204)); fieldMean.setContentType("text/html"); // NOI18N fieldMean.setAutoscrolls(false); fieldMean.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { fieldMeanKeyPressed(evt); } }); jScrollPane1.setViewportView(fieldMean); buttonEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/edit.png"))); // NOI18N buttonEdit.setText("Edit"); buttonEdit.setBorder(null); buttonEdit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonEditActionPerformed(evt); } }); buttonSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/save.png"))); // NOI18N buttonSave.setText("Save"); buttonSave.setBorder(null); buttonSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSaveActionPerformed(evt); } }); buttonDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/delete.png"))); // NOI18N buttonDelete.setText("Delete"); buttonDelete.setBorder(null); buttonDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonDeleteActionPerformed(evt); } }); buttonExit.setText("Thot"); buttonExit.setBorder(null); buttonExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonExitActionPerformed(evt); } }); javax.swing.GroupLayout frameMeanLayout = new javax.swing.GroupLayout(frameMean.getContentPane()); frameMean.getContentPane().setLayout(frameMeanLayout); frameMeanLayout .setHorizontalGroup( frameMeanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( frameMeanLayout.createSequentialGroup().addContainerGap() .addComponent(buttonEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27) .addComponent(buttonDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE) .addComponent(buttonSave, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(buttonExit, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18)) .addComponent(jScrollPane1)); frameMeanLayout.setVerticalGroup(frameMeanLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(frameMeanLayout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(frameMeanLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonSave, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonExit, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); frameEntries.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); frameEntries.setTitle("Entries"); frameEntries.setAlwaysOnTop(true); frameEntries.setAutoRequestFocus(false); frameEntries.setLocation(new java.awt.Point(320, 300)); frameEntries.setName("frameEntries"); // NOI18N frameEntries.setUndecorated(true); frameEntries.setResizable(false); frameEntries.setSize(new java.awt.Dimension(180, 220)); listEntries.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N listEntries.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); listEntries.setAutoscrolls(false); listEntries.setVerifyInputWhenFocusTarget(false); listEntries.setVisibleRowCount(6); listEntries.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { listEntriesMouseClicked(evt); } }); listEntries.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { listEntriesKeyPressed(evt); } }); jScrollPane3.setViewportView(listEntries); javax.swing.GroupLayout frameEntriesLayout = new javax.swing.GroupLayout(frameEntries.getContentPane()); frameEntries.getContentPane().setLayout(frameEntriesLayout); frameEntriesLayout.setHorizontalGroup( frameEntriesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)); frameEntriesLayout .setVerticalGroup(frameEntriesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)); frameAdd.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); frameAdd.setTitle("Add Word"); frameAdd.setLocation(new java.awt.Point(300, 100)); frameAdd.setUndecorated(true); frameAdd.setSize(new java.awt.Dimension(451, 375)); frameAdd.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { frameAddWindowClosed(evt); } }); fieldAddMean.setBorder(javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Mean")); jScrollPane2.setViewportView(fieldAddMean); buttonAdd2.setText("Add"); buttonAdd2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonAdd2ActionPerformed(evt); } }); labelWord.setText("Word"); buttonCloseAdd.setText("Close"); buttonCloseAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCloseAddActionPerformed(evt); } }); javax.swing.GroupLayout frameAddLayout = new javax.swing.GroupLayout(frameAdd.getContentPane()); frameAdd.getContentPane().setLayout(frameAddLayout); frameAddLayout.setHorizontalGroup(frameAddLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, frameAddLayout.createSequentialGroup() .addContainerGap(33, Short.MAX_VALUE) .addGroup(frameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 409, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(frameAddLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(frameAddLayout.createSequentialGroup().addComponent(labelWord) .addGap(29, 29, 29).addComponent(fieldAddWord, javax.swing.GroupLayout.PREFERRED_SIZE, 341, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(frameAddLayout.createSequentialGroup() .addComponent(buttonAdd2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(buttonCloseAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGap(22, 22, 22))); frameAddLayout.setVerticalGroup(frameAddLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(frameAddLayout.createSequentialGroup().addGap(17, 17, 17) .addGroup(frameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(fieldAddWord, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(labelWord)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(frameAddLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonAdd2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonCloseAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jScrollPane2.getAccessibleContext().setAccessibleName(""); jScrollPane2.getAccessibleContext().setAccessibleDescription(""); jScrollPane2.getAccessibleContext().setAccessibleParent(frameMean); frameSetting.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); frameSetting.setTitle("Settings"); frameSetting.setAlwaysOnTop(true); frameSetting.setLocation(new java.awt.Point(200, 100)); frameSetting.setUndecorated(true); frameSetting.setSize(new java.awt.Dimension(400, 200)); frameSetting.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { frameSettingWindowClosed(evt); } }); panelVoice.setBorder(javax.swing.BorderFactory.createTitledBorder("Voice")); buttonGroup1.add(button1); button1.setSelected(true); button1.setText("Female"); button1.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { button1ItemStateChanged(evt); } }); buttonGroup1.add(button2); button2.setText("Male"); button2.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { button1ItemStateChanged(evt); } }); javax.swing.GroupLayout panelVoiceLayout = new javax.swing.GroupLayout(panelVoice); panelVoice.setLayout(panelVoiceLayout); panelVoiceLayout.setHorizontalGroup(panelVoiceLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelVoiceLayout.createSequentialGroup().addGap(70, 70, 70).addComponent(button1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 110, Short.MAX_VALUE) .addComponent(button2).addGap(82, 82, 82))); panelVoiceLayout .setVerticalGroup(panelVoiceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelVoiceLayout.createSequentialGroup().addContainerGap(22, Short.MAX_VALUE) .addGroup(panelVoiceLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(button1).addComponent(button2)) .addGap(36, 36, 36))); buttonCloseSetting.setText("Close"); buttonCloseSetting.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCloseSettingActionPerformed(evt); } }); buttonAboutUs.setText("About Us"); buttonAboutUs.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); buttonAboutUs.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonAboutUsActionPerformed(evt); } }); javax.swing.GroupLayout frameSettingLayout = new javax.swing.GroupLayout(frameSetting.getContentPane()); frameSetting.getContentPane().setLayout(frameSettingLayout); frameSettingLayout.setHorizontalGroup(frameSettingLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, frameSettingLayout.createSequentialGroup().addContainerGap() .addComponent(panelVoice, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, frameSettingLayout.createSequentialGroup().addGap(28, 28, 28) .addComponent(buttonAboutUs, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonCloseSetting).addGap(31, 31, 31))); frameSettingLayout.setVerticalGroup(frameSettingLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(frameSettingLayout.createSequentialGroup().addGap(24, 24, 24) .addComponent(panelVoice, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(frameSettingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(buttonAboutUs, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonCloseSetting, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(23, Short.MAX_VALUE))); frameCo.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); frameCo.setTitle("Author"); frameCo.setAlwaysOnTop(true); frameCo.setLocation(new java.awt.Point(200, 100)); frameCo.setSize(new java.awt.Dimension(433, 255)); frameCo.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { frameCoWindowClosed(evt); } }); jLabel3.setBackground(new java.awt.Color(0, 102, 102)); jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel3.setText("Dictionary version 1.0"); jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText("Trn ?c Ton"); jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel5.setText("Phm Minh ?c"); jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel6.setText("Nguyn ?nh Phi"); jLabel6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel7.setText("Phm Th Thu H?ng"); jLabel8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel8.setText("Trnh Vn Thi"); jLabel8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); javax.swing.GroupLayout frameCoLayout = new javax.swing.GroupLayout(frameCo.getContentPane()); frameCo.getContentPane().setLayout(frameCoLayout); frameCoLayout.setHorizontalGroup(frameCoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE) .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); frameCoLayout.setVerticalGroup(frameCoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(frameCoLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3).addGap(24, 24, 24).addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(1, 1, 1) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24))); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Dictionary English VietNam"); setBackground(new java.awt.Color(255, 51, 0)); setLocation(new java.awt.Point(200, 100)); setResizable(false); setType(java.awt.Window.Type.POPUP); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); comboBoxEV.setBackground(new java.awt.Color(240, 240, 240)); comboBoxEV.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N comboBoxEV.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "English-VietNamese", "VietNamese-English" })); comboBoxEV.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); comboBoxEV.setFocusable(false); comboBoxEV.setRequestFocusEnabled(false); comboBoxEV.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { comboBoxEVItemStateChanged(evt); } }); fieldWord.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N fieldWord.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); fieldWord.setDoubleBuffered(true); fieldWord.setDragEnabled(true); fieldWord.setFocusCycleRoot(true); fieldWord.setFocusTraversalPolicyProvider(true); fieldWord.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { fieldWordMouseClicked(evt); } }); fieldWord.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { fieldWordKeyPressed(evt); } public void keyReleased(java.awt.event.KeyEvent evt) { fieldWordKeyReleased(evt); } }); labelDic.setFont(new java.awt.Font("Times New Roman", 0, 48)); // NOI18N labelDic.setForeground(new java.awt.Color(255, 102, 0)); labelDic.setText("Dictionary"); labelAuthor.setForeground(new java.awt.Color(255, 102, 0)); labelAuthor.setText("by HTTPD"); buttonAdd.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N buttonAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/add.png"))); // NOI18N buttonAdd.setText("Add"); buttonAdd.setBorder(null); buttonAdd.setFocusPainted(false); buttonAdd.setMargin(new java.awt.Insets(0, 14, 0, 14)); buttonAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonAddActionPerformed(evt); } }); buttonSetting.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N buttonSetting.setText("Settings"); buttonSetting.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); buttonSetting.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSettingActionPerformed(evt); } }); traonl.setText("Google Transl"); traonl.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { traonlActionPerformed(evt); } }); comboBoxOnl.setBackground(new java.awt.Color(240, 240, 240)); comboBoxOnl.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N comboBoxOnl.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Offline", "Online" })); comboBoxOnl.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); comboBoxOnl.setFocusable(false); comboBoxOnl.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { comboBoxOnlItemStateChanged(evt); } }); buttonSpeech.setForeground(new java.awt.Color(255, 255, 255)); buttonSpeech.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/speak.png"))); // NOI18N buttonSpeech.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSpeechActionPerformed(evt); } }); buttonUndo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/Undo.png"))); // NOI18N buttonUndo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonUndoActionPerformed(evt); } }); buttonFind.setIcon(new javax.swing.ImageIcon(getClass().getResource("/dictionary/images/find.png"))); // NOI18N buttonFind.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonFindActionPerformed(evt); } }); javax.swing.GroupLayout mainLayout = new javax.swing.GroupLayout(main); main.setLayout(mainLayout); mainLayout.setHorizontalGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainLayout.createSequentialGroup() .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(buttonSetting, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonAdd, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(traonl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(fieldWord, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(mainLayout.createSequentialGroup().addComponent(labelDic) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(labelAuthor)) .addGroup(mainLayout.createSequentialGroup() .addComponent(comboBoxEV, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(comboBoxOnl, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(buttonSpeech, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonFind, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) .addComponent(buttonUndo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); mainLayout.setVerticalGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonSetting, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent( traonl, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainLayout.createSequentialGroup() .addGroup(mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(labelDic).addComponent(labelAuthor)) .addGap(0, 33, Short.MAX_VALUE).addGroup( mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainLayout.createSequentialGroup().addGroup(mainLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( comboBoxEV, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(comboBoxOnl, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainLayout .createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(mainLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainLayout.createSequentialGroup().addComponent( buttonUndo, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(6, 6, 6) .addComponent( buttonFind, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(buttonSpeech, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainLayout.createSequentialGroup().addComponent( fieldWord, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())))))); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(main, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( main, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); pack(); }
From source file:au.org.ala.delta.editor.ui.image.ImageSettingsDialog.java
private void createUI() { JPanel overlayDefaultsPanel = new JPanel(); String overlayDefaultsTitle = _resources.getString("imageSettingsOverlayDefaults.title"); overlayDefaultsPanel.setBorder(/*from w w w. j av a 2 s. c o m*/ new TitledBorder(null, overlayDefaultsTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null)); JPanel imagePathPanel = new JPanel(); String imagePathTitle = _resources.getString("imageSettingsImagePath.title"); imagePathPanel.setBorder( new TitledBorder(null, imagePathTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null)); JPanel overlayFontDefaultsPanel = new JPanel(); String overlayFontTitle = _resources.getString("imageSettingsOverlayFonts.title"); overlayFontDefaultsPanel.setBorder( new TitledBorder(null, overlayFontTitle, TitledBorder.LEADING, TitledBorder.TOP, null, null)); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout .createSequentialGroup().addContainerGap() .addComponent(overlayDefaultsPanel, GroupLayout.PREFERRED_SIZE, 236, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(buttonPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE) .addComponent(overlayFontDefaultsPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE) .addComponent(imagePathPanel, GroupLayout.DEFAULT_SIZE, 685, Short.MAX_VALUE)) .addContainerGap())); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout .createSequentialGroup().addGap(10) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false) .addComponent(overlayDefaultsPanel, 0, 0, Short.MAX_VALUE) .addGroup(groupLayout.createSequentialGroup() .addComponent(imagePathPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(overlayFontDefaultsPanel, GroupLayout.PREFERRED_SIZE, 260, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(ComponentPlacement.RELATED).addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); btnOk = new JButton("Ok"); buttonPanel.add(btnOk); btnCancel = new JButton("Cancel"); buttonPanel.add(btnCancel); btnApply = new JButton("Apply"); btnApply.setHorizontalAlignment(SwingConstants.RIGHT); buttonPanel.add(btnApply); chckbxCentreInBox = new JCheckBox(); chckbxCentreInBox.setName("imageSettingsCentreInBox"); chckbxIncludeComments = new JCheckBox(); chckbxIncludeComments.setName("imageSettingsIncludeComments"); chckbxOmitDescription = new JCheckBox(); chckbxOmitDescription.setName("imageSettingsOmitDescription"); chckbxUseIntegralHeight = new JCheckBox(); chckbxUseIntegralHeight.setName("imageSettingsUseIntegralHeight"); chckbxHotspotsPopUp = new JCheckBox(); chckbxHotspotsPopUp.setName("imageSettingsHotspotsPopUp"); chckbxCustomPopupColour = new JCheckBox(); chckbxCustomPopupColour.setName("imageSettingsCustomPopupColour"); JPanel panel = new JPanel(); selectedColourLabel = new JLabel(""); selectedColourLabel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null)); selectedColourLabel.setPreferredSize(new Dimension(25, 25)); selectedColourLabel.setOpaque(true); selectedColourLabel.setEnabled(false); chooseColourButton = new JButton(); chooseColourButton.setEnabled(false); JLabel lblButtonAlignment = new JLabel(); lblButtonAlignment.setName("imageSettingsButtonAlignment"); buttonAlignmentCombo = new JComboBox(); buttonAlignmentCombo.setModel(new ButtonAlignmentModel()); buttonAlignmentCombo.setRenderer(new ButtonAlignmentRenderer()); GroupLayout gl_overlayDefaultsPanel = new GroupLayout(overlayDefaultsPanel); gl_overlayDefaultsPanel.setHorizontalGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addContainerGap() .addGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addGap(6) .addComponent(lblButtonAlignment)) .addComponent(chckbxIncludeComments).addComponent(chckbxOmitDescription) .addComponent(chckbxUseIntegralHeight).addComponent(chckbxHotspotsPopUp) .addComponent(chckbxCustomPopupColour) .addComponent(buttonAlignmentCombo, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 193, GroupLayout.PREFERRED_SIZE) .addComponent(chckbxCentreInBox)) .addContainerGap(25, Short.MAX_VALUE))); gl_overlayDefaultsPanel .setVerticalGroup(gl_overlayDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayDefaultsPanel.createSequentialGroup().addGap(10) .addComponent(chckbxCentreInBox).addPreferredGap(ComponentPlacement.RELATED) .addComponent(chckbxIncludeComments).addPreferredGap(ComponentPlacement.RELATED) .addComponent(chckbxOmitDescription).addPreferredGap(ComponentPlacement.RELATED) .addComponent(chckbxUseIntegralHeight).addPreferredGap(ComponentPlacement.RELATED) .addComponent(chckbxHotspotsPopUp).addPreferredGap(ComponentPlacement.RELATED) .addComponent(chckbxCustomPopupColour).addPreferredGap(ComponentPlacement.RELATED) .addComponent(panel, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE) .addGap(12).addComponent(lblButtonAlignment) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(buttonAlignmentCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(144, Short.MAX_VALUE))); GroupLayout gl_panel = new GroupLayout(panel); gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel.createSequentialGroup().addContainerGap() .addComponent(selectedColourLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(chooseColourButton).addGap(68))); gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING) .addGroup(gl_panel.createSequentialGroup().addContainerGap() .addGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(chooseColourButton) .addComponent(selectedColourLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel.setLayout(gl_panel); overlayDefaultsPanel.setLayout(gl_overlayDefaultsPanel); JLabel lblFontName = new JLabel(); lblFontName.setName("imageSettingsFontName"); JLabel lblSize = new JLabel(); lblSize.setName("imageSettingsFontSize"); JLabel lblBold = new JLabel(); lblBold.setName("imageSettingsFontBold"); JLabel lblItalic = new JLabel(); lblItalic.setName("imageSettingsFontItalic"); JLabel featureLabel = new JLabel(); featureLabel.setName("imageSettingsFeatureFont"); buttonFontCombo = new JComboBox(); buttonFontCombo.setModel(new FontFamilyModel()); featureSizeCombo = new JComboBox(); featureSizeCombo.setModel(new FontSizeModel()); buttonBoldCheckBox = new JCheckBox(""); featureItalicCheckBox = new JCheckBox(""); JLabel buttonLabel = new JLabel(); buttonLabel.setName("imageSettingsButtonFont"); featureFontCombo = new JComboBox(); featureFontCombo.setModel(new FontFamilyModel()); buttonSizeCombo = new JComboBox(); buttonSizeCombo.setModel(new FontSizeModel()); featureBoldCheckBox = new JCheckBox(""); buttonItalicCheckBox = new JCheckBox(""); JLabel defaultLabel = new JLabel(); defaultLabel.setName("imageSettingsDefaultFont"); defaultFontCombo = new JComboBox(); defaultFontCombo.setModel(new FontFamilyModel()); defaultSizeCombo = new JComboBox(); defaultSizeCombo.setModel(new FontSizeModel()); defaultBoldCheckBox = new JCheckBox(""); defaultItalicCheckBox = new JCheckBox(""); JLabel lblSample = new JLabel(); lblSample.setName("imageSettingsSample"); sampleTextField = new JTextField(""); chckbxSaveSampleAs = new JCheckBox(); chckbxSaveSampleAs.setSelected(true); chckbxSaveSampleAs.setName("imageSettingsSaveSampleAs"); GroupLayout gl_overlayFontDefaultsPanel = new GroupLayout(overlayFontDefaultsPanel); gl_overlayFontDefaultsPanel.setHorizontalGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup().addContainerGap() .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup() .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addComponent(defaultLabel).addComponent(featureLabel) .addComponent(buttonLabel)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.TRAILING) .addComponent(lblFontName, 0, 345, Short.MAX_VALUE) .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup() .addGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.TRAILING) .addComponent(defaultFontCombo, Alignment.LEADING, 0, 339, Short.MAX_VALUE) .addComponent(featureFontCombo, 0, 339, Short.MAX_VALUE) .addComponent(buttonFontCombo, 0, 339, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.RELATED))) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addComponent(lblSize, 0, 94, Short.MAX_VALUE) .addComponent(defaultSizeCombo, 0, 94, Short.MAX_VALUE) .addComponent(featureSizeCombo, 0, 94, Short.MAX_VALUE) .addComponent(buttonSizeCombo, 0, 94, Short.MAX_VALUE))) .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup() .addComponent(lblSample).addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addComponent(chckbxSaveSampleAs).addComponent(sampleTextField, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))) .addGap(18) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING, false) .addComponent(featureBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addComponent(defaultBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addComponent(buttonBoldCheckBox, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addComponent(lblBold, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.TRAILING) .addComponent(buttonItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addComponent(featureItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addComponent(lblItalic, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE) .addComponent(defaultItalicCheckBox, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); gl_overlayFontDefaultsPanel .setVerticalGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.LEADING).addGroup(gl_overlayFontDefaultsPanel .createSequentialGroup().addContainerGap().addGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.BASELINE).addComponent( lblSize) .addComponent(lblFontName).addComponent(lblItalic).addComponent(lblBold)) .addGap(10) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup( Alignment.BASELINE) .addComponent(defaultFontCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(defaultSizeCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(defaultLabel)) .addComponent(defaultItalicCheckBox).addComponent(defaultBoldCheckBox)) .addGap(10) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.BASELINE) .addComponent(featureFontCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(featureSizeCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(featureLabel)) .addComponent(featureItalicCheckBox).addComponent(featureBoldCheckBox)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_overlayFontDefaultsPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_overlayFontDefaultsPanel.createSequentialGroup() .addGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.BASELINE) .addComponent(buttonSizeCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(buttonFontCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(buttonLabel)) .addGap(18) .addGroup(gl_overlayFontDefaultsPanel .createParallelGroup(Alignment.BASELINE) .addComponent(sampleTextField, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE) .addComponent(lblSample)) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(chckbxSaveSampleAs)) .addComponent(buttonItalicCheckBox).addComponent(buttonBoldCheckBox)) .addContainerGap(16, Short.MAX_VALUE))); overlayFontDefaultsPanel.setLayout(gl_overlayFontDefaultsPanel); imagePathTextField = new JTextField(); imagePathTextField.setColumns(10); imagePathButton = new JButton("New button"); GroupLayout gl_imagePathPanel = new GroupLayout(imagePathPanel); gl_imagePathPanel.setHorizontalGroup(gl_imagePathPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_imagePathPanel.createSequentialGroup().addContainerGap() .addComponent(imagePathTextField, GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(imagePathButton))); gl_imagePathPanel.setVerticalGroup(gl_imagePathPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_imagePathPanel.createSequentialGroup().addContainerGap() .addGroup(gl_imagePathPanel.createParallelGroup(Alignment.BASELINE) .addComponent(imagePathTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(imagePathButton)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); imagePathPanel.setLayout(gl_imagePathPanel); getContentPane().setLayout(groupLayout); }
From source file:examples.monalisa.gui.GeneticDrawingView.java
/** This method is called from within the constructor to * initialize the form.//from www . j av a2 s. c om * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { mainPanel = new javax.swing.JPanel(); chooseImage = new javax.swing.JButton(); startEvolution = new javax.swing.JToggleButton(); targetImageLabel = new javax.swing.JLabel(); JFreeChart chart = ChartFactory.createXYLineChart("Fitness versus Generation", "Generation", "Fitness", new XYSeriesCollection(new XYSeries("")), org.jfree.chart.plot.PlotOrientation.VERTICAL, false, false, false); chartPanel = new ChartPanel(chart); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); mainPanel.setName("mainPanel"); // NOI18N javax.swing.ActionMap actionMap = org.jdesktop.application.Application .getInstance(examples.monalisa.gui.GeneticDrawingApp.class).getContext() .getActionMap(GeneticDrawingView.class, this); chooseImage.setAction(actionMap.get("chooseImage")); // NOI18N org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application .getInstance(examples.monalisa.gui.GeneticDrawingApp.class).getContext() .getResourceMap(GeneticDrawingView.class); chooseImage.setText(resourceMap.getString("chooseImage.text")); // NOI18N chooseImage.setName("chooseImage"); // NOI18N startEvolution.setAction(actionMap.get("startEvolution")); // NOI18N startEvolution.setText(resourceMap.getString("startEvolution.text")); // NOI18N startEvolution.setName("startEvolution"); // NOI18N targetImageLabel.setIcon(resourceMap.getIcon("targetImageLabel.icon")); // NOI18N targetImageLabel.setText(resourceMap.getString("targetImageLabel.text")); // NOI18N targetImageLabel.setName("targetImageLabel"); // NOI18N chartPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); chartPanel.setName("chartPanel"); // NOI18N org.jdesktop.layout.GroupLayout chartPanelLayout = new org.jdesktop.layout.GroupLayout(chartPanel); chartPanel.setLayout(chartPanelLayout); chartPanelLayout.setHorizontalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 399, Short.MAX_VALUE)); chartPanelLayout.setVerticalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 234, Short.MAX_VALUE)); org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(mainPanelLayout.createSequentialGroup().add(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(mainPanelLayout.createSequentialGroup().add(47, 47, 47).add(chooseImage) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(startEvolution) .add(38, 38, 38)) .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(targetImageLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(80, 80, 80))) .add(chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); mainPanelLayout.setVerticalGroup(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup() .addContainerGap() .add(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(mainPanelLayout.createSequentialGroup() .add(targetImageLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(startEvolution).add(chooseImage)))) .addContainerGap())); chooseImage.getAccessibleContext() .setAccessibleName(resourceMap.getString("jButton1.AccessibleContext.accessibleName")); // NOI18N menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N exitMenuItem.setAction(actionMap.get("quit")); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); setComponent(mainPanel); setMenuBar(menuBar); }
From source file:src.examples.monalisa.gui.GeneticDrawingView.java
/** This method is called from within the constructor to * initialize the form./*w w w .j ava 2s . c om*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { mainPanel = new javax.swing.JPanel(); chooseImage = new javax.swing.JButton(); startEvolution = new javax.swing.JToggleButton(); targetImageLabel = new javax.swing.JLabel(); JFreeChart chart = ChartFactory.createXYLineChart("Fitness versus Generation", "Generation", "Fitness", new XYSeriesCollection(new XYSeries("")), org.jfree.chart.plot.PlotOrientation.VERTICAL, false, false, false); chartPanel = new ChartPanel(chart); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); mainPanel.setName("mainPanel"); // NOI18N javax.swing.ActionMap actionMap = org.jdesktop.application.Application .getInstance(src.examples.monalisa.gui.GeneticDrawingApp.class).getContext() .getActionMap(GeneticDrawingView.class, this); chooseImage.setAction(actionMap.get("chooseImage")); // NOI18N org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application .getInstance(src.examples.monalisa.gui.GeneticDrawingApp.class).getContext() .getResourceMap(GeneticDrawingView.class); chooseImage.setText(resourceMap.getString("chooseImage.text")); // NOI18N chooseImage.setName("chooseImage"); // NOI18N startEvolution.setAction(actionMap.get("startEvolution")); // NOI18N startEvolution.setText(resourceMap.getString("startEvolution.text")); // NOI18N startEvolution.setName("startEvolution"); // NOI18N targetImageLabel.setIcon(resourceMap.getIcon("targetImageLabel.icon")); // NOI18N targetImageLabel.setText(resourceMap.getString("targetImageLabel.text")); // NOI18N targetImageLabel.setName("targetImageLabel"); // NOI18N chartPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); chartPanel.setName("chartPanel"); // NOI18N org.jdesktop.layout.GroupLayout chartPanelLayout = new org.jdesktop.layout.GroupLayout(chartPanel); chartPanel.setLayout(chartPanelLayout); chartPanelLayout.setHorizontalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 399, Short.MAX_VALUE)); chartPanelLayout.setVerticalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 234, Short.MAX_VALUE)); org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(mainPanelLayout.createSequentialGroup().add(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(mainPanelLayout.createSequentialGroup().add(47, 47, 47).add(chooseImage) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(startEvolution) .add(38, 38, 38)) .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(targetImageLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(80, 80, 80))) .add(chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); mainPanelLayout.setVerticalGroup(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup() .addContainerGap() .add(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(mainPanelLayout.createSequentialGroup() .add(targetImageLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(startEvolution).add(chooseImage)))) .addContainerGap())); chooseImage.getAccessibleContext() .setAccessibleName(resourceMap.getString("jButton1.AccessibleContext.accessibleName")); // NOI18N menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N exitMenuItem.setAction(actionMap.get("quit")); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); setComponent(mainPanel); setMenuBar(menuBar); }
From source file:com.main.Welcome.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.// w ww . j av a 2s . c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jPanel5 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable2 = new javax.swing.JTable(); jPanel6 = new javax.swing.JPanel(); jScrollPane3 = new javax.swing.JScrollPane(); jTable3 = new javax.swing.JTable(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setLocationByPlatform(true); setMaximumSize(new java.awt.Dimension(650, 400)); setMinimumSize(new java.awt.Dimension(650, 400)); setUndecorated(true); jPanel1.setBackground(new java.awt.Color(153, 153, 153)); jPanel2.setBackground(new java.awt.Color(204, 204, 204)); jPanel2.setLayout(new java.awt.BorderLayout()); jPanel2.add(jButton1, java.awt.BorderLayout.CENTER); jButton2.setText("Patient List"); jButton2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.lightGray, java.awt.Color.darkGray, java.awt.Color.lightGray, java.awt.Color.lightGray)); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel2.add(jButton2, java.awt.BorderLayout.PAGE_START); jButton3.setText("Lab Results"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel2.add(jButton3, java.awt.BorderLayout.PAGE_END); jButton4.setText("Analytics"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jPanel2.add(jButton4, java.awt.BorderLayout.LINE_END); jPanel3.setLayout(new java.awt.CardLayout()); jPanel4.setBackground(new java.awt.Color(153, 153, 153)); jTable1.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane1.setViewportView(jTable1); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout .setHorizontalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE)); jPanel3.add(jPanel4, "card2"); jPanel5.setBackground(new java.awt.Color(204, 204, 204)); jTable2.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane2.setViewportView(jTable2); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout .setHorizontalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE)); jPanel3.add(jPanel5, "card2"); jPanel6.setBackground(new java.awt.Color(153, 153, 153)); jTable3.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane3.setViewportView(jTable3); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE)); jPanel3.add(jPanel6, "card2"); jButton5.setText("BACK"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jButton6.setText("BAR CHART"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton6).addGap(84, 84, 84).addComponent(jButton5).addGap(24, 24, 24))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(11, 11, 11).addComponent( jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))))); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); pack(); setLocationRelativeTo(null); }
From source file:examples.gp.monalisa.gui.GeneticDrawingView.java
/** This method is called from within the constructor to * initialize the form./*from ww w .j a va 2 s .c om*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { mainPanel = new javax.swing.JPanel(); chooseImage = new javax.swing.JButton(); startEvolution = new javax.swing.JToggleButton(); targetImageLabel = new javax.swing.JLabel(); saveCheckBox = new JCheckBox(); saveCheckBox.setText("Save every fittest result to file"); targetSaveDirLabel = new JLabel("Target directory:"); try { targetSaveDirEdit = new JLabel(FileKit.getCurrentDir()); } catch (IOException ex) { targetSaveDirEdit = new JLabel(); } JFreeChart chart = ChartFactory.createXYLineChart("Fitness versus Generation", "Generation", "Fitness", new XYSeriesCollection(new XYSeries("")), org.jfree.chart.plot.PlotOrientation.VERTICAL, false, false, false); chartPanel = new ChartPanel(chart); menuBar = new javax.swing.JMenuBar(); javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); javax.swing.JMenu helpMenu = new javax.swing.JMenu(); javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem(); mainPanel.setName("mainPanel"); // NOI18N javax.swing.ActionMap actionMap = org.jdesktop.application.Application .getInstance(examples.gp.monalisa.gui.GeneticDrawingApp.class).getContext() .getActionMap(GeneticDrawingView.class, this); chooseImage.setAction(actionMap.get("chooseImage")); // NOI18N org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application .getInstance(examples.gp.monalisa.gui.GeneticDrawingApp.class).getContext() .getResourceMap(GeneticDrawingView.class); chooseImage.setText(resourceMap.getString("chooseImage.text")); // NOI18N chooseImage.setName("chooseImage"); // NOI18N startEvolution.setAction(actionMap.get("startEvolution")); // NOI18N startEvolution.setText(resourceMap.getString("startEvolution.text")); // NOI18N startEvolution.setName("startEvolution"); // NOI18N targetImageLabel.setIcon(resourceMap.getIcon("targetImageLabel.icon")); // NOI18N targetImageLabel.setText(resourceMap.getString("targetImageLabel.text")); // NOI18N targetImageLabel.setName("targetImageLabel"); // NOI18N chartPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); chartPanel.setName("chartPanel"); // NOI18N org.jdesktop.layout.GroupLayout chartPanelLayout = new org.jdesktop.layout.GroupLayout(chartPanel); chartPanel.setLayout(chartPanelLayout); chartPanelLayout.setHorizontalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 399, Short.MAX_VALUE)); chartPanelLayout.setVerticalGroup(chartPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(0, 234, Short.MAX_VALUE)); org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel); mainPanel.setLayout(mainPanelLayout); mainPanelLayout.setHorizontalGroup(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(mainPanelLayout.createSequentialGroup().add(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) .add(mainPanelLayout.createSequentialGroup().add(47, 47, 47).add(chooseImage) .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED).add(startEvolution) .add(38, 38, 38)) .add(mainPanelLayout.createSequentialGroup().add(47, 47, 47).add(saveCheckBox).add(140, 140, 140)) .add(mainPanelLayout.createSequentialGroup().add(47, 47, 47).add(targetSaveDirLabel) .add(targetSaveDirEdit).add(47, 47, 47)) .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup() .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(targetImageLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 200, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(80, 80, 80))) .add(chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); mainPanelLayout.setVerticalGroup(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, mainPanelLayout.createSequentialGroup() .addContainerGap() .add(mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add(org.jdesktop.layout.GroupLayout.LEADING, chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(mainPanelLayout.createSequentialGroup().add(saveCheckBox) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(targetSaveDirLabel).add(targetSaveDirEdit) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(targetImageLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 202, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(mainPanelLayout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(startEvolution).add(chooseImage)))) .addContainerGap())); chooseImage.getAccessibleContext() .setAccessibleName(resourceMap.getString("jButton1.AccessibleContext.accessibleName")); // NOI18N menuBar.setName("menuBar"); // NOI18N fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N fileMenu.setName("fileMenu"); // NOI18N exitMenuItem.setAction(actionMap.get("quit")); // NOI18N exitMenuItem.setName("exitMenuItem"); // NOI18N fileMenu.add(exitMenuItem); menuBar.add(fileMenu); helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N helpMenu.setName("helpMenu"); // NOI18N aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N aboutMenuItem.setName("aboutMenuItem"); // NOI18N helpMenu.add(aboutMenuItem); menuBar.add(helpMenu); setComponent(mainPanel); setMenuBar(menuBar); }
From source file:br.unicamp.cst.util.MindViewer.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from w w w . j ava2 s . c om*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; pnSimulationControl = new javax.swing.JPanel(); lblRefreshTime = new javax.swing.JLabel(); txtRefreshTime = new javax.swing.JFormattedTextField(); btnPlus = new javax.swing.JButton(); btnMinus = new javax.swing.JButton(); tbControl = new javax.swing.JTabbedPane(); jspMainSplit = new javax.swing.JSplitPane(); splMainChart = new javax.swing.JSplitPane(); pnMindEntities = new javax.swing.JPanel(); cbRefreshMindsEntities = new javax.swing.JCheckBox(); jtpMindsEntities = new javax.swing.JTabbedPane(); jspMindsEntities = new javax.swing.JScrollPane(); pnChart = new javax.swing.JPanel(); cbRefreshChart = new javax.swing.JCheckBox(); pnCodelets = new javax.swing.JPanel(); sdChart = new javax.swing.JSlider(); tbModules = new javax.swing.JTabbedPane(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMinimumSize(new java.awt.Dimension(800, 600)); setSize(new java.awt.Dimension(1024, 768)); getContentPane().setLayout(new java.awt.GridBagLayout()); lblRefreshTime.setText("Refresh Time (ms):"); txtRefreshTime.setEditable(false); txtRefreshTime.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory( new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); txtRefreshTime.setText("100"); txtRefreshTime.setToolTipText(""); txtRefreshTime.setEnabled(false); btnPlus.setText("+"); btnPlus.setMargin(new java.awt.Insets(0, 0, 0, 0)); btnPlus.setMaximumSize(new java.awt.Dimension(25, 25)); btnPlus.setMinimumSize(new java.awt.Dimension(25, 25)); btnPlus.setPreferredSize(new java.awt.Dimension(25, 25)); btnPlus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPlusActionPerformed(evt); } }); btnMinus.setText("-"); btnMinus.setMargin(new java.awt.Insets(0, 0, 0, 0)); btnMinus.setMaximumSize(new java.awt.Dimension(25, 25)); btnMinus.setMinimumSize(new java.awt.Dimension(25, 25)); btnMinus.setPreferredSize(new java.awt.Dimension(25, 25)); btnMinus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnMinusActionPerformed(evt); } }); javax.swing.GroupLayout pnSimulationControlLayout = new javax.swing.GroupLayout(pnSimulationControl); pnSimulationControl.setLayout(pnSimulationControlLayout); pnSimulationControlLayout.setHorizontalGroup( pnSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnSimulationControlLayout.createSequentialGroup().addContainerGap() .addComponent(lblRefreshTime) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtRefreshTime, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnPlus, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnMinus, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(417, Short.MAX_VALUE))); pnSimulationControlLayout.setVerticalGroup( pnSimulationControlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnSimulationControlLayout.createSequentialGroup().addContainerGap() .addGroup(pnSimulationControlLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(btnPlus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(pnSimulationControlLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblRefreshTime).addComponent(txtRefreshTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(btnMinus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 0.1; getContentPane().add(pnSimulationControl, gridBagConstraints); jspMainSplit.setDividerLocation(220); jspMainSplit.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT); splMainChart.setDividerLocation(400); pnMindEntities.setMinimumSize(new java.awt.Dimension(0, 0)); pnMindEntities.setLayout(new java.awt.GridBagLayout()); cbRefreshMindsEntities.setSelected(true); cbRefreshMindsEntities.setText("Auto Refresh"); cbRefreshMindsEntities.setToolTipText(""); cbRefreshMindsEntities.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cbRefreshMindsEntitiesActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; pnMindEntities.add(cbRefreshMindsEntities, gridBagConstraints); jtpMindsEntities.addTab("Mind's Memories", jspMindsEntities); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.ipadx = 161; gridBagConstraints.ipady = 197; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 0.1; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 2); pnMindEntities.add(jtpMindsEntities, gridBagConstraints); splMainChart.setLeftComponent(pnMindEntities); pnMindEntities.getAccessibleContext().setAccessibleName(""); pnChart.setMinimumSize(new java.awt.Dimension(0, 0)); pnChart.setName(""); // NOI18N pnChart.setLayout(new java.awt.GridBagLayout()); cbRefreshChart.setSelected(true); cbRefreshChart.setText("Auto Refresh"); cbRefreshChart.setToolTipText(""); cbRefreshChart.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cbRefreshChartActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; pnChart.add(cbRefreshChart, gridBagConstraints); pnCodelets.setBackground(new java.awt.Color(102, 102, 102)); javax.swing.GroupLayout pnCodeletsLayout = new javax.swing.GroupLayout(pnCodelets); pnCodelets.setLayout(pnCodeletsLayout); pnCodeletsLayout.setHorizontalGroup(pnCodeletsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 366, Short.MAX_VALUE)); pnCodeletsLayout.setVerticalGroup(pnCodeletsLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 177, Short.MAX_VALUE)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 10.0; pnChart.add(pnCodelets, gridBagConstraints); sdChart.setToolTipText(""); sdChart.setValue(100); sdChart.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { sdChartStateChanged(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 15; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.PAGE_END; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 0.1; pnChart.add(sdChart, gridBagConstraints); splMainChart.setRightComponent(pnChart); jspMainSplit.setTopComponent(splMainChart); tbModules.setMinimumSize(new java.awt.Dimension(0, 0)); jspMainSplit.setRightComponent(tbModules); tbModules.getAccessibleContext().setAccessibleName("Motivational Subsystem"); tbModules.getAccessibleContext().setAccessibleDescription(""); tbControl.addTab("Mind's Entities", jspMainSplit); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 0.1; getContentPane().add(tbControl, gridBagConstraints); pack(); }
From source file:cz.cvut.kbe.crypthelper.ui.MainPanel.java
/** This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//w w w . ja va 2 s . c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup = new javax.swing.ButtonGroup(); alphaButtonGroup = new javax.swing.ButtonGroup(); jScrollPane1 = new javax.swing.JScrollPane(); inputText = new javax.swing.JTextArea(); jPanel1 = new javax.swing.JPanel(); bottomPanel = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); charTable = new javax.swing.JTable(); graphPanel = new javax.swing.JPanel(); offsetSlider = new javax.swing.JSlider(); percentOption = new javax.swing.JRadioButton(); perCountOption = new javax.swing.JRadioButton(); jLabel1 = new javax.swing.JLabel(); alphabetSelect = new javax.swing.JComboBox(); coincidenceIndexLabel = new javax.swing.JLabel(); processButton = new javax.swing.JButton(); inputText.setColumns(20); inputText.setFont(new java.awt.Font("Courier New", 0, 14)); // NOI18N inputText.setLineWrap(true); inputText.setRows(5); jScrollPane1.setViewportView(inputText); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102))); charTable.setAutoCreateRowSorter(true); charTable.setFont(new java.awt.Font("Courier New", 0, 14)); // NOI18N charTable.setModel(new javax.swing.table.DefaultTableModel( new Object[][] { { null, null }, { null, null }, { null, null }, { null, null } }, new String[] { "Znak", "etnost" }) { Class[] types = new Class[] { java.lang.String.class, java.lang.Integer.class }; boolean[] canEdit = new boolean[] { false, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); charTable.setIntercellSpacing(new java.awt.Dimension(1, 3)); jScrollPane2.setViewportView(charTable); javax.swing.GroupLayout graphPanelLayout = new javax.swing.GroupLayout(graphPanel); graphPanel.setLayout(graphPanelLayout); graphPanelLayout.setHorizontalGroup(graphPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 478, Short.MAX_VALUE)); graphPanelLayout.setVerticalGroup(graphPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 140, Short.MAX_VALUE)); offsetSlider.setMajorTickSpacing(1); offsetSlider.setMaximum(25); offsetSlider.setMinorTickSpacing(1); offsetSlider.setPaintLabels(true); offsetSlider.setPaintTicks(true); offsetSlider.setToolTipText("Posunut abecedy"); offsetSlider.setValue(0); percentOption.setText("v procentech"); perCountOption.setText("v po?tu vskyt"); jLabel1.setText("Abeceda:"); alphabetSelect.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); javax.swing.GroupLayout bottomPanelLayout = new javax.swing.GroupLayout(bottomPanel); bottomPanel.setLayout(bottomPanelLayout); bottomPanelLayout.setHorizontalGroup(bottomPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(bottomPanelLayout.createSequentialGroup().addContainerGap().addGroup(bottomPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(perCountOption) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(percentOption)).addGap(18, 18, 18) .addGroup(bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(graphPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(offsetSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(bottomPanelLayout.createSequentialGroup().addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(alphabetSelect, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))))); bottomPanelLayout.setVerticalGroup(bottomPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(bottomPanelLayout.createSequentialGroup().addComponent(percentOption) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(bottomPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(alphabetSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(perCountOption)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(bottomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(bottomPanelLayout.createSequentialGroup() .addComponent(graphPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(offsetSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(bottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(bottomPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); coincidenceIndexLabel.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N coincidenceIndexLabel.setText("coincidenceIndexLabel"); processButton.setText("Analyzovat"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 663, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup().addComponent(processButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(coincidenceIndexLabel)) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(processButton).addComponent(coincidenceIndexLabel)) .addGap(18, 18, 18).addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); }
From source file:ca.sfu.federation.viewer.propertysheet.LinePropertySheet.java
/** * ParametricModelSheet constructor.// ww w. j av a 2 s . co m */ public LinePropertySheet() { lblINamedObject = new JLabel(); lblName = new JLabel(); lblDescription = new JLabel(); jtfClass = new JTextField(); jtfName = new JTextField(); jtfCanonicalName = new JTextField(); lblCanonicalName = new JLabel(); lblClass = new JLabel(); jtfDescription = new JTextField(); lblParentContext = new JLabel(); jtfParentContext = new JTextField(); lblStartPoint = new JLabel(); lblMidPoint = new JLabel(); lblEndPoint = new JLabel(); jtfStartPoint = new JTextField(); jtfMidPoint = new JTextField(); jtfEndPoint = new JTextField(); lblUpdateMethod = new JLabel(); jcbUpdateMethod = new JComboBox(); jspUpdateMethodInputs = new JPanel(); lblLength = new JLabel(); jtfLength = new JTextField(); lblDirection = new javax.swing.JLabel(); jtfDirection = new javax.swing.JTextField(); lblINamedObject.setFont(new java.awt.Font("Tahoma", 0, 14)); lblINamedObject.setText("jLabel1"); lblName.setText("Name"); lblDescription.setText("Description"); lblCanonicalName.setText("Canonical Name"); lblClass.setText("Class"); lblParentContext.setText("Parent Context"); lblStartPoint.setText("StartPoint"); lblMidPoint.setText("MidPoint"); lblEndPoint.setText("EndPoint"); lblUpdateMethod.setText("Update Method"); lblLength.setText("Length"); lblDirection.setText("Direction"); jtfClass.setEditable(false); jtfCanonicalName.setEditable(false); jtfParentContext.setEditable(false); jtfStartPoint.setEditable(false); jtfMidPoint.setEditable(false); jtfEndPoint.setEditable(false); jtfLength.setEditable(false); jtfDirection.setEditable(false); jspUpdateMethodInputs.setLayout(new BorderLayout()); jspUpdateMethodInputs.setBorder(javax.swing.BorderFactory.createEtchedBorder()); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout .createSequentialGroup().addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(org.jdesktop.layout.GroupLayout.TRAILING, jspUpdateMethodInputs, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE) .add(lblINamedObject) .add(layout.createSequentialGroup() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(lblCanonicalName).add(lblClass).add(lblName).add(lblDescription) .add(lblParentContext).add(lblStartPoint).add(lblEndPoint).add(lblMidPoint) .add(lblDirection).add(lblLength)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jtfName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfClass, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(jtfCanonicalName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)) .add(jtfParentContext, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfStartPoint, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfMidPoint, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfEndPoint, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfLength, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .add(jtfDirection, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE))) .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() .add(lblUpdateMethod).add(6, 6, 6).add(jcbUpdateMethod, 0, 221, Short.MAX_VALUE))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup().addContainerGap().add(lblINamedObject) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfClass, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblClass)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblName)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(lblCanonicalName) .add(jtfCanonicalName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(lblDescription).add(jtfDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(lblParentContext) .add(jtfParentContext, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(lblStartPoint) .add(jtfStartPoint, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfMidPoint, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblMidPoint)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfEndPoint, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblEndPoint)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfLength, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblLength)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jtfDirection, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblDirection)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(jcbUpdateMethod, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblUpdateMethod)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jspUpdateMethodInputs, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE) .addContainerGap())); // disable non editable fields this.jtfCanonicalName.setEditable(false); this.jtfClass.setEditable(false); this.jtfParentContext.setEditable(false); // set field values this.setValues(); // set action listeners jtfName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfNameActionListener(evt); } }); jtfDescription.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jtfDescriptionActionListener(evt); } }); jcbUpdateMethod.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcbUpdateMethodActionListener(evt); } }); }
From source file:com.josescalia.tumblr.form.TumblrRssFavList.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.// w w w. j av a 2 s.co m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); labelValueListCellRenderer1 = new com.josescalia.tumblr.util.swing.LabelValueListCellRenderer(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jComboBox1 = new javax.swing.JComboBox(); txtSearchVal = new javax.swing.JTextField(); btnFind = new javax.swing.JButton(); panelForm = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); txtRssTitle = new javax.swing.JTextField(); txtRssLink = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); pnlButton = new javax.swing.JPanel(); btnNew2 = new javax.swing.JButton(); btnSave = new javax.swing.JButton(); btnCancel = new javax.swing.JButton(); btnEdit = new javax.swing.JButton(); btnDelete = new javax.swing.JButton(); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty .create("${dataList}"); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings .createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${title}")); columnBinding.setColumnName("Title"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${link}")); columnBinding.setColumnName("Link"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${selectedItem}"), jTable1, org.jdesktop.beansbinding.BeanProperty.create("selectedElement")); bindingGroup.addBinding(binding); jScrollPane1.setViewportView(jTable1); if (jTable1.getColumnModel().getColumnCount() > 0) { jTable1.getColumnModel().getColumn(0).setResizable(false); jTable1.getColumnModel().getColumn(0).setPreferredWidth(100); jTable1.getColumnModel().getColumn(1).setResizable(false); jTable1.getColumnModel().getColumn(1).setPreferredWidth(300); } jComboBox1.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); jComboBox1.setRenderer(labelValueListCellRenderer1); eLProperty = org.jdesktop.beansbinding.ELProperty.create("${filterList}"); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings .createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, jComboBox1); bindingGroup.addBinding(jComboBoxBinding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${filter}"), jComboBox1, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${filterText}"), txtSearchVal, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); btnFind.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/magnifier.png"))); // NOI18N btnFind.setText("Find"); btnFind.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFindActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtSearchVal, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnFind, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtSearchVal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnFind)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE) .addContainerGap())); panelForm.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jLabel1.setText("Title"); txtRssTitle.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${formBean.title}"), txtRssTitle, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); txtRssLink.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${formBean.link}"), txtRssLink, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel2.setText("Link"); javax.swing.GroupLayout panelFormLayout = new javax.swing.GroupLayout(panelForm); panelForm.setLayout(panelFormLayout); panelFormLayout.setHorizontalGroup(panelFormLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelFormLayout.createSequentialGroup().addContainerGap() .addGroup(panelFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(panelFormLayout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtRssTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(191, 191, 191)) .addGroup(panelFormLayout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtRssLink, javax.swing.GroupLayout.PREFERRED_SIZE, 434, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(39, Short.MAX_VALUE))); panelFormLayout.setVerticalGroup(panelFormLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelFormLayout.createSequentialGroup().addContainerGap().addGroup(panelFormLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1) .addComponent(txtRssTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(txtRssLink, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); pnlButton.setBorder(javax.swing.BorderFactory.createEtchedBorder()); btnNew2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/add.png"))); // NOI18N btnNew2.setText("New"); btnNew2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnNew2.setName("btnNew"); // NOI18N btnNew2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnNew2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnNew2ActionPerformed(evt); } }); btnSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/save.png"))); // NOI18N btnSave.setText("Save"); btnSave.setEnabled(false); btnSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnSave.setName("btnSave"); // NOI18N btnSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveActionPerformed(evt); } }); btnCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/cancel.png"))); // NOI18N btnCancel.setText("Cancel"); btnCancel.setEnabled(false); btnCancel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnCancel.setName("btnCancel"); // NOI18N btnCancel.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelActionPerformed(evt); } }); btnEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnEdit.setText("Edit"); btnEdit.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnEdit.setName("btnEdit"); // NOI18N btnEdit.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnEdit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnEditActionPerformed(evt); } }); btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete.png"))); // NOI18N btnDelete.setText("Delete"); btnDelete.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); btnDelete.setName("btnDelete"); // NOI18N btnDelete.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); btnDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDeleteActionPerformed(evt); } }); javax.swing.GroupLayout pnlButtonLayout = new javax.swing.GroupLayout(pnlButton); pnlButton.setLayout(pnlButtonLayout); pnlButtonLayout .setHorizontalGroup(pnlButtonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlButtonLayout.createSequentialGroup().addContainerGap() .addComponent(btnNew2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnDelete, javax.swing.GroupLayout.DEFAULT_SIZE, 98, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); pnlButtonLayout.setVerticalGroup(pnlButtonLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnlButtonLayout.createSequentialGroup().addContainerGap() .addGroup(pnlButtonLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnEdit).addComponent(btnNew2).addComponent(btnSave) .addComponent(btnCancel).addComponent(btnDelete)) .addContainerGap())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(pnlButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(panelForm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(panelForm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pnlButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(20, 20, 20))))); bindingGroup.bind(); }