List of usage examples for javax.swing JPasswordField JPasswordField
public JPasswordField()
JPasswordField
, with a default document, null
starting text string, and 0 column width. From source file:com.compomics.pladipus.controller.setup.InstallPladipus.java
/** * Queries the user for the valid user login and password * * @throws IOException//from www. jav a 2 s.c o m */ public boolean validateUser() throws IOException { JPanel panel = new JPanel(new BorderLayout(5, 5)); JPanel label = new JPanel(new GridLayout(0, 1, 2, 2)); label.add(new JLabel("Username", SwingConstants.RIGHT)); label.add(new JLabel("Password", SwingConstants.RIGHT)); panel.add(label, BorderLayout.WEST); JPanel controls = new JPanel(new GridLayout(0, 1, 2, 2)); JTextField username = new JTextField(); controls.add(username); JPasswordField password = new JPasswordField(); controls.add(password); panel.add(controls, BorderLayout.CENTER); int showConfirmDialog = JOptionPane.showConfirmDialog(null, panel, "Pladipus Login", JOptionPane.OK_CANCEL_OPTION); if (showConfirmDialog == JOptionPane.CANCEL_OPTION) { return false; } String user = username.getText(); String pass = new String(password.getPassword()); if (login(user, pass)) { writeWorkerBash(user, pass); return true; } else { throw new SecurityException("User credentials are incorrect!"); } }
From source file:com.josescalia.tumblr.form.PreferenceForm.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 av a 2 s .c o m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); rbGroupUseProxy = new ButtonGroup(); folderChooser = new JFileChooser(); jTabbedPane1 = new JTabbedPane(); jPanel1 = new JPanel(); jPanel10 = new JPanel(); jLabel29 = new JLabel(); jLabel26 = new JLabel(); jLabel25 = new JLabel(); jLabel24 = new JLabel(); jLabel28 = new JLabel(); jLabel27 = new JLabel(); jPanel12 = new JPanel(); txtProxyPort = new JTextField(); rbUseProxy = new JRadioButton(); jLabel2 = new JLabel(); rbNoProxy = new JRadioButton(); txtProxyPassword = new JPasswordField(); jLabel3 = new JLabel(); txtProxyUsername = new JTextField(); btnSaveProxyConfig = new JButton(); jLabel1 = new JLabel(); jLabel4 = new JLabel(); txtProxyHost = new JTextField(); checkProxyNeedAuth = new JCheckBox(); jPanel2 = new JPanel(); jPanel11 = new JPanel(); jLabel35 = new JLabel(); jLabel30 = new JLabel(); jLabel33 = new JLabel(); jLabel32 = new JLabel(); jLabel31 = new JLabel(); jLabel34 = new JLabel(); jPanel14 = new JPanel(); txtDefaultFolderPath1 = new JTextField(); jLabel6 = new JLabel(); txtDefaultFolderPath = new JTextField(); jLabel7 = new JLabel(); btnChooseFolder = new JButton(); btnSaveAppConfig = new JButton(); jPanel7 = new JPanel(); jPanel9 = new JPanel(); jLabel18 = new JLabel(); jLabel23 = new JLabel(); jLabel19 = new JLabel(); jLabel21 = new JLabel(); jLabel20 = new JLabel(); jLabel22 = new JLabel(); jPanel13 = new JPanel(); jLabel8 = new JLabel(); btnOpenOtherCacheFolder = new JButton(); btnDeleteCache = new JButton(); jLabel9 = new JLabel(); txtTotalFileSize1 = new JTextField(); txtTotalFileSize = new JTextField(); jPanel3 = new JPanel(); jPanel5 = new JPanel(); txtTotalLogSize = new JTextField(); jLabel11 = new JLabel(); txtTotalLog = new JTextField(); btnCleanLog = new JButton(); jLabel13 = new JLabel(); jPanel6 = new JPanel(); jLabel12 = new JLabel(); jScrollPane1 = new JScrollPane(); txtLogContent = new JTextArea(); jPanel8 = new JPanel(); jLabel17 = new JLabel(); jLabel16 = new JLabel(); jLabel15 = new JLabel(); jLabel14 = new JLabel(); jPanel4 = new JPanel(); jPanel15 = new JPanel(); txtAppLookAndFeel = new JTextField(); jLabel10 = new JLabel(); btnSaveLF = new JButton(); btnSelectLF = new JButton(); jPanel16 = new JPanel(); jLabel41 = new JLabel(); jLabel36 = new JLabel(); jLabel40 = new JLabel(); jLabel37 = new JLabel(); jLabel38 = new JLabel(); jLabel39 = new JLabel(); jLabel5 = new JLabel(); jPanel1.setBorder(BorderFactory.createEtchedBorder()); jPanel10.setBackground(Color.white); jPanel10.setBorder(BorderFactory.createEtchedBorder()); jLabel29.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel29.setText("set up this Proxy Connection."); jLabel26.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel26.setText("if this application need to connect to the internet. The setting of this "); jLabel25.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel25.setText("The Proxy Connection is a set of configuration which will be applied"); jLabel24.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel24.setText("Info :"); jLabel28.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel28.setText("configuration. Contact Computer Network Administrator to correctly"); jLabel27.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel27.setText("Proxy Connection should be match with the computer network"); GroupLayout jPanel10Layout = new GroupLayout(jPanel10); jPanel10.setLayout(jPanel10Layout); jPanel10Layout.setHorizontalGroup(jPanel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel28).addComponent(jLabel25).addComponent(jLabel24) .addComponent(jLabel26).addComponent(jLabel27).addComponent(jLabel29)) .addContainerGap())); jPanel10Layout.setVerticalGroup(jPanel10Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel10Layout.createSequentialGroup().addContainerGap().addComponent(jLabel24) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel25) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel26) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel27) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel28) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel29) .addContainerGap())); jPanel12.setBorder(BorderFactory.createEtchedBorder()); txtProxyPort.setEnabled(false); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyPort}"), txtProxyPort, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); rbGroupUseProxy.add(rbUseProxy); rbUseProxy.setText("Use Proxy"); rbUseProxy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbUseProxyActionPerformed(evt); } }); jLabel2.setText("Proxy Port"); rbGroupUseProxy.add(rbNoProxy); rbNoProxy.setText("No Proxy"); rbNoProxy.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { rbNoProxyActionPerformed(evt); } }); txtProxyPassword.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyPassword}"), txtProxyPassword, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel3.setText("Username "); txtProxyUsername.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyUsername}"), txtProxyUsername, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); btnSaveProxyConfig.setIcon(new ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnSaveProxyConfig.setText("Save"); btnSaveProxyConfig.setHorizontalTextPosition(SwingConstants.CENTER); btnSaveProxyConfig.setVerticalTextPosition(SwingConstants.BOTTOM); btnSaveProxyConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveProxyConfigActionPerformed(evt); } }); jLabel1.setText("Proxy Host"); jLabel4.setText("Password"); txtProxyHost.setEnabled(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${proxyConnection.proxyHost}"), txtProxyHost, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); checkProxyNeedAuth.setText("Proxy Need Authentication"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${bUseProxyAuth}"), checkProxyNeedAuth, org.jdesktop.beansbinding.BeanProperty.create("selected")); bindingGroup.addBinding(binding); checkProxyNeedAuth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkProxyNeedAuthActionPerformed(evt); } }); GroupLayout jPanel12Layout = new GroupLayout(jPanel12); jPanel12.setLayout(jPanel12Layout); jPanel12Layout.setHorizontalGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addContainerGap().addGroup(jPanel12Layout .createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addComponent(rbNoProxy) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(rbUseProxy)) .addGroup(jPanel12Layout.createSequentialGroup().addGroup(jPanel12Layout .createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3).addComponent(jLabel4)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(txtProxyPort, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE) .addComponent(txtProxyHost, GroupLayout.PREFERRED_SIZE, 297, GroupLayout.PREFERRED_SIZE) .addGroup(jPanel12Layout .createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(txtProxyPassword, GroupLayout.Alignment.LEADING) .addComponent(txtProxyUsername, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 227, GroupLayout.PREFERRED_SIZE)))) .addComponent(checkProxyNeedAuth).addComponent(btnSaveProxyConfig, GroupLayout.PREFERRED_SIZE, 89, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanel12Layout.setVerticalGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel12Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(rbNoProxy).addComponent(rbUseProxy)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(txtProxyHost, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(txtProxyPort, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(4, 4, 4).addComponent(checkProxyNeedAuth) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(txtProxyUsername, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel12Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(txtProxyPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSaveProxyConfig) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); GroupLayout jPanel1Layout = new GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup( jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(286, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(11, 11, 11) .addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jPanel12, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jPanel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap(165, Short.MAX_VALUE))); jTabbedPane1.addTab("Proxy Connection", jPanel1); jPanel2.setBorder(BorderFactory.createEtchedBorder()); jPanel11.setBackground(Color.white); jPanel11.setBorder(BorderFactory.createEtchedBorder()); jLabel35.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel35.setText("the application is trigger to open a folder."); jLabel30.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel30.setText("Info :"); jLabel33.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel33.setText("application downloading stuff from the internet."); jLabel32.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel32.setText("Default Download Path is the default folder location when the "); jLabel31.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel31.setText("This is the set of configuration will be used by this application."); jLabel34.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel34.setText("Default Folder Viewer is the default of computer programs when "); GroupLayout jPanel11Layout = new GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup(jPanel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel30).addComponent(jLabel31).addComponent(jLabel32) .addComponent(jLabel33).addComponent(jLabel34).addComponent(jLabel35)) .addContainerGap())); jPanel11Layout.setVerticalGroup(jPanel11Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel11Layout.createSequentialGroup().addContainerGap().addComponent(jLabel30) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel31) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel32) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel33) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel34) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel35) .addContainerGap())); jPanel14.setBorder(BorderFactory.createEtchedBorder()); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultFolderViewer}"), txtDefaultFolderPath1, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel6.setText("Default Download Path"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultDownloadPath}"), txtDefaultFolderPath, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel7.setText("Default Folder Viewer"); btnChooseFolder.setText("Change"); btnChooseFolder.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnChooseFolderActionPerformed(evt); } }); btnSaveAppConfig.setIcon(new ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnSaveAppConfig.setText("Save"); btnSaveAppConfig.setHorizontalTextPosition(SwingConstants.CENTER); btnSaveAppConfig.setVerticalTextPosition(SwingConstants.BOTTOM); btnSaveAppConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveAppConfigActionPerformed(evt); } }); GroupLayout jPanel14Layout = new GroupLayout(jPanel14); jPanel14.setLayout(jPanel14Layout); jPanel14Layout.setHorizontalGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup().addContainerGap().addGroup(jPanel14Layout .createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup() .addComponent(jLabel7, GroupLayout.PREFERRED_SIZE, 161, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtDefaultFolderPath1, GroupLayout.PREFERRED_SIZE, 258, GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel14Layout.createSequentialGroup() .addComponent(jLabel6, GroupLayout.PREFERRED_SIZE, 161, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtDefaultFolderPath, GroupLayout.PREFERRED_SIZE, 346, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnChooseFolder)) .addComponent(btnSaveAppConfig, GroupLayout.PREFERRED_SIZE, 95, GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanel14Layout.setVerticalGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel14Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(txtDefaultFolderPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(btnChooseFolder)) .addGap(4, 4, 4) .addGroup(jPanel14Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel7).addComponent(txtDefaultFolderPath1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnSaveAppConfig).addContainerGap())); GroupLayout jPanel2Layout = new GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout .setHorizontalGroup( jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel14, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel11, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel11, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel14, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(285, Short.MAX_VALUE))); jTabbedPane1.addTab("Application Config", jPanel2); jPanel9.setBackground(Color.white); jPanel9.setBorder(BorderFactory.createEtchedBorder()); jLabel18.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel18.setText("Info :"); jLabel23.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel23.setText("make the application processing faster."); jLabel19.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel19.setText("Cache Info contains a summary of how much space in hard drive"); jLabel21.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel21.setText("hard drive space by this application, but if the application need to"); jLabel20.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel20.setText("used by this application. Deleting cache will reduce the usage of"); jLabel22.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel22.setText("fetch the data from internet, this cache will be used in order to"); GroupLayout jPanel9Layout = new GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup(jPanel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel18).addComponent(jLabel19).addComponent(jLabel20) .addComponent(jLabel21).addComponent(jLabel22).addComponent(jLabel23)) .addContainerGap())); jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap().addComponent(jLabel18) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel19) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel20) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel21) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel22) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel23) .addContainerGap())); jPanel13.setBorder(BorderFactory.createEtchedBorder()); jLabel8.setText("Total Cache File Size"); btnOpenOtherCacheFolder.setIcon(new ImageIcon(getClass().getResource("/icons/folder_open.png"))); // NOI18N btnOpenOtherCacheFolder.setText("Open Dir"); btnOpenOtherCacheFolder.setHorizontalTextPosition(SwingConstants.CENTER); btnOpenOtherCacheFolder.setVerticalTextPosition(SwingConstants.BOTTOM); btnOpenOtherCacheFolder.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnOpenOtherCacheFolderActionPerformed(evt); } }); btnDeleteCache.setIcon(new ImageIcon(getClass().getResource("/icons/cross2.png"))); // NOI18N btnDeleteCache.setText("Delete Cache"); btnDeleteCache.setHorizontalTextPosition(SwingConstants.CENTER); btnDeleteCache.setVerticalTextPosition(SwingConstants.BOTTOM); btnDeleteCache.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDeleteCacheActionPerformed(evt); } }); jLabel9.setText("Total Cache File"); txtTotalFileSize1.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${cacheFile.fileListSize}"), txtTotalFileSize1, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); txtTotalFileSize.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${cacheFile.totalFolderSize}"), txtTotalFileSize, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); GroupLayout jPanel13Layout = new GroupLayout(jPanel13); jPanel13.setLayout(jPanel13Layout); jPanel13Layout.setHorizontalGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel8).addComponent(jLabel9).addComponent(btnDeleteCache)) .addGap(18, 18, 18) .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(txtTotalFileSize1, GroupLayout.Alignment.LEADING) .addComponent(btnOpenOtherCacheFolder, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE) .addComponent(txtTotalFileSize)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel13Layout.setVerticalGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel13Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(txtTotalFileSize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel9).addComponent(txtTotalFileSize1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel13Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(btnDeleteCache, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnOpenOtherCacheFolder)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); GroupLayout jPanel7Layout = new GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel13, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel9, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(443, Short.MAX_VALUE))); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel7Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel9, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel13, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(289, Short.MAX_VALUE))); jTabbedPane1.addTab("Cache Info", jPanel7); jPanel5.setBorder(BorderFactory.createEtchedBorder()); txtTotalLogSize.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${logFile.totalFolderSize}"), txtTotalLogSize, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel11.setText("Total File on Log Folder"); txtTotalLog.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${logFile.fileListSize}"), txtTotalLog, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); btnCleanLog.setIcon(new ImageIcon(getClass().getResource("/icons/cross2.png"))); // NOI18N btnCleanLog.setText("Clean Log File"); btnCleanLog.setHorizontalTextPosition(SwingConstants.CENTER); btnCleanLog.setVerticalTextPosition(SwingConstants.BOTTOM); btnCleanLog.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCleanLogActionPerformed(evt); } }); jLabel13.setText("Total Size on Log Folder "); GroupLayout jPanel5Layout = new GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(btnCleanLog, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel13).addComponent(jLabel11)) .addGap(18, 18, 18) .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(txtTotalLog, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE) .addComponent(txtTotalLogSize, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE)))) .addContainerGap(22, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(txtTotalLog, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(jLabel11)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel13).addComponent(txtTotalLogSize, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCleanLog, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel6.setBorder(BorderFactory.createEtchedBorder()); jLabel12.setText("Log File Data :"); txtLogContent.setEditable(false); txtLogContent.setColumns(20); txtLogContent.setLineWrap(true); txtLogContent.setRows(5); txtLogContent.setWrapStyleWord(true); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${logFileData}"), txtLogContent, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jScrollPane1.setViewportView(txtLogContent); GroupLayout jPanel6Layout = new GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 724, Short.MAX_VALUE) .addGroup(jPanel6Layout.createSequentialGroup().addComponent(jLabel12).addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanel6Layout .setVerticalGroup(jPanel6Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addComponent(jLabel12) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 339, GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel8.setBackground(Color.white); jPanel8.setBorder(BorderFactory.createEtchedBorder()); jLabel17.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel17.setText("application use it as a log tracker."); jLabel16.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel16.setText("These 2 log files cannot be delete, because the"); jLabel15.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel15.setText("Minimal log files is 2 files."); jLabel14.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel14.setText("Info :"); GroupLayout jPanel8Layout = new GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup(jPanel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel14).addComponent(jLabel15).addComponent(jLabel16) .addComponent(jLabel17)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel8Layout.createSequentialGroup().addContainerGap().addComponent(jLabel14) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel15) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel16) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel17) .addContainerGap())); GroupLayout jPanel3Layout = new GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup( GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel8, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel6, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGap(20, 20, 20) .addGroup(jPanel3Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jPanel6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(jPanel5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addContainerGap(41, Short.MAX_VALUE))); jTabbedPane1.addTab("Log Monitor", jPanel3); jPanel15.setBorder(BorderFactory.createEtchedBorder()); txtAppLookAndFeel.setEditable(false); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${defaultLookAndFeel}"), txtAppLookAndFeel, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel10.setText("Look And Feel "); btnSaveLF.setIcon(new ImageIcon(getClass().getResource("/icons/edit.png"))); // NOI18N btnSaveLF.setText("Save"); btnSaveLF.setHorizontalTextPosition(SwingConstants.CENTER); btnSaveLF.setVerticalTextPosition(SwingConstants.BOTTOM); btnSaveLF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSaveLFActionPerformed(evt); } }); btnSelectLF.setText("Change Look and Feel"); btnSelectLF.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnSelectLFActionPerformed(evt); } }); GroupLayout jPanel15Layout = new GroupLayout(jPanel15); jPanel15.setLayout(jPanel15Layout); jPanel15Layout.setHorizontalGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addContainerGap().addComponent(jLabel10) .addGap(4, 4, 4) .addGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(btnSaveLF, GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE) .addComponent(txtAppLookAndFeel, GroupLayout.PREFERRED_SIZE, 395, GroupLayout.PREFERRED_SIZE) .addComponent(btnSelectLF, GroupLayout.PREFERRED_SIZE, 176, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel15Layout.setVerticalGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel15Layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(jLabel10).addComponent(txtAppLookAndFeel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSelectLF) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(btnSaveLF) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel16.setBackground(Color.white); jPanel16.setBorder(BorderFactory.createEtchedBorder()); jLabel41.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel41.setText("to be restarted."); jLabel36.setFont(new Font("Liberation Sans", 1, 12)); // NOI18N jLabel36.setText("Info :"); jLabel40.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel40.setText("System. Changing Look and Feel requires application"); jLabel37.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel37.setText("Changing the Look and Feel means changing this"); jLabel38.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel38.setText("application theme, the theme provided by it's installed"); jLabel39.setFont(new Font("Liberation Sans", 0, 12)); // NOI18N jLabel39.setText("Look and Feel class in the Java Runtime Environment"); GroupLayout jPanel16Layout = new GroupLayout(jPanel16); jPanel16.setLayout(jPanel16Layout); jPanel16Layout.setHorizontalGroup(jPanel16Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel16Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jLabel36).addComponent(jLabel37).addComponent(jLabel38) .addComponent(jLabel39).addComponent(jLabel40).addComponent(jLabel41)) .addContainerGap())); jPanel16Layout.setVerticalGroup(jPanel16Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap().addComponent(jLabel36) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel37) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel38) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel39) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel40) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel41) .addContainerGap())); GroupLayout jPanel4Layout = new GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout .setHorizontalGroup( jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel15, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel16, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(261, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false) .addComponent(jPanel16, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel15, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(289, Short.MAX_VALUE))); jTabbedPane1.addTab("Look And Feel", jPanel4); jLabel5.setFont(new Font("DejaVu Sans", 1, 18)); // NOI18N jLabel5.setHorizontalAlignment(SwingConstants.CENTER); jLabel5.setText("System Configuration"); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(jTabbedPane1).addComponent(jLabel5, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addComponent(jLabel5) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jTabbedPane1))); bindingGroup.bind(); }
From source file:com.codeasylum.liquibase.Liquidate.java
public Liquidate() { super("Liquidate"); ParaboxLayoutManager layout;//from w ww . j ava 2 s . c o m ParallelBox goalHorizontalBox; SerialBox sourceHorizontalBox; ParallelBox sourceVerticalBox; SerialBox goalVerticalBox; JSeparator buttonSeparator; JRadioButton[] sourceButtons; JRadioButton[] goalButtons; JLabel databaseLabel; JLabel hostLabel; JLabel colonLabel; JLabel schemaLabel; JLabel userLabel; JLabel passwordLabel; JLabel sourceLabel; JLabel goalLabel; JLabel outputLabel; int sourceIndex = 0; int goalIndex = 0; config = new LiquidateConfig(); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLayout(layout = new ParaboxLayoutManager(getContentPane())); databaseLabel = new JLabel("Database:"); databaseCombo = new JComboBox(Database.values()); databaseCombo.addItemListener(this); hostLabel = new JLabel("Host and Port:"); hostTextField = new JTextField(); hostTextField.getDocument().addDocumentListener(this); portTextField = new JTextField(); portTextField.setHorizontalAlignment(JTextField.RIGHT); portTextField.setPreferredSize(new Dimension(50, (int) portTextField.getPreferredSize().getHeight())); portTextField.setMaximumSize(portTextField.getPreferredSize()); portTextField.getDocument().addDocumentListener(this); colonLabel = new JLabel(":"); schemaLabel = new JLabel("Schema:"); schemaTextField = new JTextField(); schemaTextField.getDocument().addDocumentListener(this); userLabel = new JLabel("User:"); userTextField = new JTextField(); userTextField.getDocument().addDocumentListener(this); passwordLabel = new JLabel("Password:"); passwordField = new JPasswordField(); passwordField.getDocument().addDocumentListener(this); sourceLabel = new JLabel("Change Log:"); sourceButtonGroup = new EventCoalescingButtonGroup(); sourceButtons = new JRadioButton[Source.values().length]; for (Source source : Source.values()) { sourceButtonGroup.add(sourceButtons[sourceIndex] = new JRadioButton( StringUtilities.toDisplayCase(source.name(), '_'))); sourceButtons[sourceIndex++].setActionCommand(source.name()); } sourceButtons[0].setSelected(true); sourceButtonGroup.addActionListener(this); changeLogTextField = new JTextField(); changeLogTextField.getDocument().addDocumentListener(this); goalLabel = new JLabel("Goal:"); goalButtonGroup = new EventCoalescingButtonGroup(); goalButtons = new JRadioButton[Goal.values().length - 1]; for (Goal goal : Goal.values()) { if (!goal.equals(Goal.NONE)) { goalButtonGroup.add( goalButtons[goalIndex] = new JRadioButton(StringUtilities.toDisplayCase(goal.name(), '_'))); goalButtons[goalIndex++].setActionCommand(goal.name()); } } goalButtons[0].setSelected(true); goalButtonGroup.addActionListener(this); outputLabel = new JLabel("Output:"); browseButton = new JButton("Browse...", BROWSE_ICON); browseButton.setMargin(new Insets(2, 2, 2, 2)); browseButton.setFocusable(false); browseButton.setToolTipText("browse for a file"); browseButton.addActionListener(this); browseButton.setEnabled(false); outputTextField = new JTextField(); outputTextField.getDocument().addDocumentListener(this); outputTextField.setEnabled(false); buttonSeparator = new JSeparator(JSeparator.HORIZONTAL); buttonSeparator.setMaximumSize( new Dimension(Integer.MAX_VALUE, (int) buttonSeparator.getPreferredSize().getHeight())); startButton = new JButton("Start"); startButton.addActionListener(this); layout.setHorizontalBox(layout.parallelBox().add(layout.sequentialBox() .add(layout.parallelBox(Alignment.TRAILING).add(databaseLabel).add(hostLabel).add(schemaLabel) .add(userLabel).add(passwordLabel).add(sourceLabel).add(goalLabel).add(outputLabel)) .add(goalHorizontalBox = layout.parallelBox().add(databaseCombo, Constraint.expand()) .add(layout.sequentialBox(3).add(hostTextField, Constraint.expand()).add(colonLabel) .add(portTextField)) .add(schemaTextField, Constraint.expand()).add(userTextField, Constraint.expand()) .add(passwordField, Constraint.expand()).add(sourceHorizontalBox = layout.sequentialBox()) .add(changeLogTextField, Constraint.expand()) .add(layout.parallelBox(Alignment.TRAILING).add(outputTextField, Constraint.expand()) .add(browseButton)))) .add(buttonSeparator, Constraint.expand()) .add(layout.sequentialBox(Justification.LAST, true).add(startButton))); for (JRadioButton sourceButton : sourceButtons) { sourceHorizontalBox.add(sourceButton); } for (JRadioButton goalButton : goalButtons) { goalHorizontalBox.add(goalButton); } layout.setVerticalBox(layout.sequentialBox() .add(layout.sequentialBox() .add(layout.parallelBox(Alignment.BASELINE).add(databaseLabel).add(databaseCombo)) .add(layout.parallelBox(Alignment.BASELINE).add(hostLabel).add(hostTextField) .add(colonLabel).add(portTextField)) .add(layout.parallelBox(Alignment.BASELINE).add(schemaLabel).add(schemaTextField)) .add(layout.parallelBox(Alignment.BASELINE).add(userLabel).add(userTextField)) .add(layout.parallelBox(Alignment.BASELINE).add(passwordLabel).add(passwordField))) .add(layout.sequentialBox(3) .add(layout.parallelBox(Alignment.CENTER).add(sourceLabel) .add(sourceVerticalBox = layout.parallelBox())) .add(changeLogTextField)) .add(goalVerticalBox = layout.sequentialBox(Gap.NONE) .add(layout.parallelBox(Alignment.BASELINE).add(goalLabel).add(goalButtons[0])))); for (JRadioButton sourceButton : sourceButtons) { sourceVerticalBox.add(sourceButton); } for (int count = 1; count < goalButtons.length; count++) { goalVerticalBox.add(goalButtons[count]); } layout.getVerticalBox() .add(layout.sequentialBox(Gap.RELATED) .add(layout.parallelBox(Alignment.BASELINE).add(outputLabel).add(outputTextField)) .add(browseButton)) .add(layout.sequentialBox(Gap.RELATED).add(buttonSeparator).add(startButton)); setSize(new Dimension(((int) getLayout().preferredLayoutSize(this).getWidth()) + 150, ((int) getLayout().preferredLayoutSize(this).getHeight()) + 50)); setResizable(false); setLocationByPlatform(true); }
From source file:MainProgram.MainProgram.java
private void initComponents() throws InterruptedException { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents welcomeMessage = new JLabel(); welcomeMessage2 = new JLabel(); pennIDLabel = new JLabel(); pennIDTextField = new JTextField(); pennPassLabel = new JLabel(); pennPassField = new JPasswordField(); emailLabel = new JLabel(); emailTextField = new JTextField(); emailDomainLabel = new JLabel(); emailPassLabel = new JLabel(); emailPassField = new JPasswordField(); semesterLabel = new JLabel(); semesterComboBox = new JComboBox(semestersString); credentials = new JLabel(); dropLabel = new JLabel(); dropCheckBox = new JCheckBox(); button = new JButton(); stopWatchLabel = new JLabel(); checkMail = false;//from w w w .j a v a 2s. c om testConnection = false; mailCheckTimeInitializer(); StopWatchInitializer(); try { setUIFont(new javax.swing.plaf.FontUIResource("Segoe UI", Font.ROMAN_BASELINE, 12)); } catch (Exception e) { e.printStackTrace(MainProgram.errorLog); } String lcOSName = System.getProperty("os.name").toLowerCase(); boolean IS_MAC = lcOSName.startsWith("mac os x"); //======== this ======== setLayout(new GridBagLayout()); ((GridBagLayout) getLayout()).columnWidths = new int[] { 81, 5, 119, 5, 0, 0 }; if (!IS_MAC) { ((GridBagLayout) getLayout()).rowHeights = new int[] { 17, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 0, 0, 0 }; } ((GridBagLayout) getLayout()).rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 }; GridBagConstraints constraints = new GridBagConstraints(); constraints.gridx = 0; constraints.gridy = 0; constraints.fill = GridBagConstraints.HORIZONTAL; //---- welcomeMessage ---- welcomeMessage.setText("Course Registration"); welcomeMessage.setHorizontalAlignment(SwingConstants.CENTER); add(welcomeMessage, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- welcomeMessage2 ---- welcomeMessage2.setText("for Penn State (BETA)"); welcomeMessage2.setHorizontalAlignment(SwingConstants.CENTER); add(welcomeMessage2, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- pennIDLabel ---- pennIDLabel.setText("Penn State ID: "); pennIDLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(pennIDLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- pennIDTextField ---- pennIDTextField.setText("xxx123"); add(pennIDTextField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- pennPassLabel ---- pennPassLabel.setText("Penn State Password: "); pennPassLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(pennPassLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(pennPassField, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailLabel ---- emailLabel.setText("Email: "); emailLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(emailLabel, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailTextField ---- emailTextField.setText("myEmail"); add(emailTextField, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailDomainLabel ---- emailDomainLabel.setText("@mail.com"); add(emailDomainLabel, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- emailPassLabel ---- emailPassLabel.setText("Email Password: "); emailPassLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(emailPassLabel, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(emailPassField, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); //---- Semester label ---- semesterLabel.setText("Semester/Drop Option: "); semesterLabel.setHorizontalAlignment(SwingConstants.RIGHT); add(semesterLabel, new GridBagConstraints(0, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- Semester ComboBox ---- add(semesterComboBox, new GridBagConstraints(1, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- Drop CheckBox ---- add(dropCheckBox, new GridBagConstraints(2, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- button ---- button.setText("Start"); add(button, new GridBagConstraints(1, 16, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- stopWatchLabel ---- stopWatchLabel.setText(" " + stopWatchSplitting[0]); stopWatchLabel.setHorizontalAlignment(SwingConstants.LEFT); add(stopWatchLabel, new GridBagConstraints(2, 16, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); //---- label11 ---- credentials.setText(" Created by Daniyar Yeralin"); credentials.setForeground(Color.gray); credentials.setHorizontalAlignment(SwingConstants.RIGHT); credentials.setFont(new Font("Cambria", Font.ITALIC, 12)); add(credentials, new GridBagConstraints(2, 17, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); /*button.registerKeyboardAction(button.getActionForKeyStroke( KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, false)), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED); button.registerKeyboardAction(button.getActionForKeyStroke( KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0, true)), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true), JComponent.WHEN_FOCUSED);*/ StartButtonHandler buttonListener = new StartButtonHandler(); button.addActionListener(buttonListener); }
From source file:finale.year.stage.main.Authentification.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 ww w .j av a 2s . com */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - unknown private void initComponents() { innerPanel = new JPanel(); emailField = new JTextField(); rememberMe = new JCheckBox(); logInBtn = new JButton(); passWord = new JPasswordField(); signUpBtn = new JButton(); forgotBtn = new JButton(); userIcon = new JLabel(); passwordIcon = new JLabel(); errorStatusBar = new JLabel(); //======== this ======== // JFormDesigner evaluation mark setBorder( new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); setLayout(new GridBagLayout()); //======== innerPanel ======== { innerPanel.setBorder(new EtchedBorder()); //---- emailField ---- emailField.setText("Email"); emailField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { emailFieldActionPerformed(e); } }); //---- rememberMe ---- rememberMe.setText("Remember me"); rememberMe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { rememberMeActionPerformed(e); } }); //---- logInBtn ---- logInBtn.setText("Log In"); logInBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { logInBtnActionPerformed(e); } }); //---- passWord ---- passWord.setText("password"); //---- signUpBtn ---- signUpBtn.setText("Sign Up"); signUpBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { signUpBtnActionPerformed(e); } }); //---- forgotBtn ---- forgotBtn.setText("Forgot Password?"); forgotBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { forgotBtnActionPerformed(e); } }); //---- userIcon ---- userIcon.setIcon(new ImageIcon(getClass().getResource("/Resources/glyphicons_user.png"))); //---- passwordIcon ---- passwordIcon.setIcon(new ImageIcon(getClass().getResource("/Resources/glyphicons_lock.png"))); GroupLayout innerPanelLayout = new GroupLayout(innerPanel); innerPanel.setLayout(innerPanelLayout); innerPanelLayout.setHorizontalGroup(innerPanelLayout.createParallelGroup().addGroup(innerPanelLayout .createSequentialGroup() .addGroup(innerPanelLayout.createParallelGroup() .addGroup(innerPanelLayout.createSequentialGroup().addGap(106, 106, 106) .addComponent(forgotBtn)) .addGroup(innerPanelLayout.createSequentialGroup().addGap(73, 73, 73) .addGroup(innerPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(userIcon, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE) .addComponent(passwordIcon, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(innerPanelLayout .createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addComponent(passWord).addComponent(emailField, GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE))) .addGroup(innerPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING, false) .addGroup(innerPanelLayout.createSequentialGroup().addGap(106, 106, 106) .addComponent(rememberMe) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(logInBtn, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE)) .addGroup(innerPanelLayout.createSequentialGroup().addGap(375, 375, 375) .addComponent(signUpBtn, GroupLayout.PREFERRED_SIZE, 79, GroupLayout.PREFERRED_SIZE))) .addGroup(innerPanelLayout.createSequentialGroup().addGap(218, 218, 218) .addComponent(errorStatusBar))) .addContainerGap(100, Short.MAX_VALUE))); innerPanelLayout.setVerticalGroup(innerPanelLayout.createParallelGroup().addGroup(innerPanelLayout .createSequentialGroup().addContainerGap().addComponent(errorStatusBar).addGap(30, 30, 30) .addGroup(innerPanelLayout.createParallelGroup() .addComponent(userIcon, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE) .addComponent(emailField, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)) .addGap(30, 30, 30) .addGroup(innerPanelLayout.createParallelGroup() .addComponent(passwordIcon, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE) .addComponent(passWord, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addGroup( innerPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(rememberMe, GroupLayout.PREFERRED_SIZE, 59, GroupLayout.PREFERRED_SIZE) .addComponent(logInBtn)) .addGap(6, 6, 6).addComponent(forgotBtn).addGap(6, 6, 6).addComponent(signUpBtn) .addContainerGap(69, Short.MAX_VALUE))); } add(innerPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), -20, 4)); }
From source file:MainFrame.MainFrame.java
public MainFrame() { //Create menu this.menuBar = new JMenuBar(); this.menuProxy = new JMenu("Proxy"); this.menuBar.add(menuProxy); this.cbMenuItem = new JCheckBoxMenuItem("? proxy"); this.cbMenuItem.setMnemonic(KeyEvent.VK_C); ActionListener aListener = new ActionListener() { public void actionPerformed(ActionEvent event) { AbstractButton aButton = (AbstractButton) event.getSource(); boolean selected = aButton.getModel().isSelected(); if (selected) { SingleDataHolder.getInstance().isProxyActivated = true; SingleDataHolder.getInstance().proxyIpAdress = MainFrame.this.proxyIpAdress.getText(); SingleDataHolder.getInstance().proxyPort = Integer.parseInt(MainFrame.this.proxyPort.getText()); SingleDataHolder.getInstance().proxyLogin = MainFrame.this.proxyLogin.getText(); SingleDataHolder.getInstance().proxyPassword = String .valueOf(MainFrame.this.proxyPassword.getPassword()); } else { SingleDataHolder.getInstance().isProxyActivated = false; }// w w w . java2s. co m } }; this.cbMenuItem.addActionListener(aListener); this.proxyIpAdress = new JTextField(); this.proxyPort = new JTextField(); this.proxyLogin = new JTextField(); ; this.proxyPassword = new JPasswordField(); this.menuProxy.add(this.cbMenuItem); this.menuProxy.add(new JLabel("IP ?")); this.menuProxy.add(this.proxyIpAdress); this.menuProxy.add(new JLabel("? ")); this.menuProxy.add(this.proxyPort); this.menuProxy.add(new JLabel("")); this.menuProxy.add(this.proxyLogin); this.menuProxy.add(new JLabel("")); this.menuProxy.add(this.proxyPassword); this.setJMenuBar(this.menuBar); communicator = new HttpCommunicator(); myActionListener = new mainFrameActionListener(); mainPanel = new JPanel(new BorderLayout()); this.setContentPane(mainPanel); JPanel P = new JPanel(new FlowLayout(FlowLayout.LEFT, 15, 5)); mainPanel.add(P, BorderLayout.NORTH); //Create Group label labelGroup = new JLabel(""); P.add(labelGroup); //Create Group combo comboGroup = new JComboBox(); comboGroup.addItem("?"); comboGroup.addActionListener(myActionListener); P.add(comboGroup); //Create Date label labelDate = new JLabel(""); P.add(labelDate); //Create Date combo comboDate = new JComboBox(); comboDate.addItem("?"); comboDate.addActionListener(myActionListener); P.add(comboDate); //Create Delete button buttonDelete = new JButton(""); buttonDelete.setEnabled(false); buttonDelete.addActionListener(myActionListener); P.add(buttonDelete); //this.checkConnection = new CheckConnection(buttonDelete); buttonPasswordsManager = new JButton(" "); buttonPasswordsManager.addActionListener(myActionListener); P.add(buttonPasswordsManager); try { Image img = ImageIO.read(getClass().getResource("resources/table_refresh.png")); this.buttonRefresh = new JButton(new ImageIcon(img)); this.buttonRefresh.addActionListener(myActionListener); this.buttonRefresh.setToolTipText(" "); P.add(buttonRefresh); } catch (IOException ex) { Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); } //CreateLessonTableModel lessonTableModel = new LessonTableModel(); try { communicator.setCombos(comboGroup, comboDate, lessonTableModel); } catch (IOException ex) { JOptionPane.showMessageDialog(null, " ? ? ."); Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); } //CreateTable table = new JTable(lessonTableModel); table.setFillsViewportHeight(true); table.setAutoCreateRowSorter(true); JScrollPane scrollP = new JScrollPane(table); mainPanel.add(scrollP, BorderLayout.CENTER); //Create Table sorter sorter = new TableRowSorter<LessonTableModel>(lessonTableModel); table.setRowSorter(sorter); table.getModel().addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent e) { int row = e.getFirstRow(); int column = e.getColumn(); TableModel model = (TableModel) e.getSource(); for (int i = 0; i < model.getRowCount(); i++) { if ((boolean) model.getValueAt(i, 2) == true) { buttonDelete.setEnabled(true); return; } } buttonDelete.setEnabled(false); } }); //Standart block this.setSize(700, 400); this.setTitle(" "); this.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent we) { System.exit(0); } }); try { Image img = ImageIO.read(getClass().getResource("resources/appIcon.png")); this.setIconImage(img); } catch (IOException ex) { Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex); } this.setVisible(true); }
From source file:edu.cmu.cs.diamond.pathfind.DjangoAnnotationStore.java
private void login(String loginuri) throws IOException { String username = prefs.get("username", ""); String password = ""; JLabel label = new JLabel("Please enter your username and password:"); JTextField jtf = new JTextField(username); JPasswordField jpf = new JPasswordField(); int dialogResult = JOptionPane.showConfirmDialog(null, new Object[] { label, jtf, jpf }, "Login to PathFind", JOptionPane.OK_CANCEL_OPTION); if (dialogResult == JOptionPane.OK_OPTION) { username = jtf.getText();/*from w ww . j av a 2s . com*/ prefs.put("username", username); password = new String(jpf.getPassword()); } else { throw new IOException("User refused to login"); } // get the form to get the cookies GetMethod form = new GetMethod(loginuri); try { if (httpClient.executeMethod(form) != 200) { throw new IOException("Can't GET " + loginuri); } } finally { form.releaseConnection(); } // get cookies Cookie[] cookies = httpClient.getState().getCookies(); for (Cookie c : cookies) { System.out.println(c); if (c.getName().equals("csrftoken")) { csrftoken = c.getValue(); break; } } // now, post PostMethod post = new PostMethod(loginuri); try { post.addRequestHeader("Referer", loginuri); NameValuePair params[] = { new NameValuePair("username", username), new NameValuePair("password", password), new NameValuePair("csrfmiddlewaretoken", csrftoken) }; //System.out.println(Arrays.toString(params)); post.setRequestBody(params); httpClient.executeMethod(post); System.out.println(post.getResponseBodyAsString()); } finally { post.releaseConnection(); } }
From source file:customize.swing.startMain.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - unknown panel1 = new JPanel(); JPanel panel2 = new JPanel(); JScrollPane scrollPane1 = new JScrollPane(); JPanel panel3 = new JPanel(); JPanel panel4 = new JPanel(); JPanel panel5 = new JPanel(); textField6 = new JTextField(); JPanel panel6 = new JPanel(); JLabel label1 = new JLabel(); JPanel panel7 = new JPanel(); JLabel label2 = new JLabel(); JPanel panel8 = new JPanel(); JLabel label3 = new JLabel(); JPanel panel9 = new JPanel(); textField2 = new JTextField(); ButtonView = new JButton(); JPanel panel10 = new JPanel(); textField7 = new JTextField(); JPanel panel11 = new JPanel(); textField1 = new JTextField(); JPanel panel12 = new JPanel(); JLabel label4 = new JLabel(); JPanel panel13 = new JPanel(); CheckBox1 = new JCheckBox(); CheckBox2 = new JCheckBox(); JPanel panel14 = new JPanel(); genButton = new JButton(); JScrollPane scrollPane2 = new JScrollPane(); JPanel panel15 = new JPanel(); JPanel panel16 = new JPanel(); TextField = new JTextField(); JPanel panel17 = new JPanel(); textField3 = new JTextField(); JPanel panel18 = new JPanel(); rootTextField = new JTextField(); JPanel panel19 = new JPanel(); PasswordField = new JPasswordField(); JPanel panel20 = new JPanel(); textField8 = new JTextField(); JPanel panel21 = new JPanel(); JLabel label5 = new JLabel(); JPanel panel22 = new JPanel(); JLabel label6 = new JLabel(); JPanel panel23 = new JPanel(); JLabel label7 = new JLabel(); JPanel panel24 = new JPanel(); JLabel label8 = new JLabel(); JPanel panel25 = new JPanel(); JLabel label9 = new JLabel(); JScrollPane scrollPane3 = new JScrollPane(); jscrollPane1 = new JTextPane(); //======== panel1 ======== {/* w w w . j a v a2 s. com*/ // JFormDesigner evaluation mark panel1.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), panel1.getBorder())); panel1.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); panel1.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1)); //======== panel2 ======== { panel2.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); //======== scrollPane1 ======== { scrollPane1.setBorder(new TitledBorder("\u6587\u4ef6\u751f\u6210\u5730\u5740")); //======== panel3 ======== { panel3.setLayout(new GridLayoutManager(4, 2, new Insets(0, 0, 0, 0), -1, -1)); //======== panel4 ======== { panel4.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //======== panel5 ======== { panel5.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField6 ---- textField6.setEditable(true); textField6.setEnabled(true); textField6.setText(""); textField6.putClientProperty("html.disable", false); panel5.add(textField6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel4.add(panel5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); } panel3.add(panel4, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel6 ======== { panel6.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label1 ---- label1.setText("xml\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b"); panel6.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel6, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel7 ======== { panel7.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label2 ---- label2.setText("model\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b"); panel7.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel7, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel8 ======== { panel8.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label3 ---- label3.setText("\u6587\u4ef6\u7edf\u4e00\u751f\u6210\u8def\u5f84"); panel8.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel9 ======== { panel9.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); panel9.add(textField2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); //---- ButtonView ---- ButtonView.setText("\u6d4f\u89c8"); panel9.add(ButtonView, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel9, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel10 ======== { panel10.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField7 ---- textField7.setEditable(true); textField7.setEnabled(true); textField7.setText(""); textField7.putClientProperty("html.disable", true); panel10.add(textField7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel10, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel11 ======== { panel11.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField1 ---- textField1.setEditable(true); textField1.setEnabled(true); textField1.setText(""); textField1.putClientProperty("html.disable", true); panel11.add(textField1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel11, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel12 ======== { panel12.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label4 ---- label4.setText("dao\u5c42\u751f\u6210\u5728\u54ea\u4e2a\u5305\u540d\u4e0b"); panel12.add(label4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel3.add(panel12, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); } scrollPane1.setViewportView(panel3); } panel2.add(scrollPane1, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null)); } panel1.add(panel2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel13 ======== { panel13.setBorder(new TitledBorder("\u53ef\u914d\u7f6e\u9879")); panel13.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); //---- CheckBox1 ---- CheckBox1.setSelected(true); CheckBox1.setText("\u662f\u5426\u4e3a\u9a7c\u5cf0\u547d\u540d\u89c4\u8303"); panel13.add(CheckBox1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); //---- CheckBox2 ---- CheckBox2.setSelected(true); CheckBox2.setText("\u662f\u5426\u751f\u6210\u6ce8\u91ca"); panel13.add(CheckBox2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel1.add(panel13, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel14 ======== { panel14.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- genButton ---- genButton.setText("\u751f\u6210"); panel14.add(genButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel1.add(panel14, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== scrollPane2 ======== { scrollPane2.setBorder(new TitledBorder("\u5fc5\u586b\u9879")); //======== panel15 ======== { panel15.setLayout(new GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1)); //======== panel16 ======== { panel16.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- TextField ---- TextField.setText("com.mysql.jdbc.Driver"); panel16.add(TextField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel16, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel17 ======== { panel17.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField3 ---- textField3.setText("jdbc:mysql://192.168.0.13/mvp?characterEncoding=UTF-8"); panel17.add(textField3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel17, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel18 ======== { panel18.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- rootTextField ---- rootTextField.setText("root"); panel18.add(rootTextField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel18, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel19 ======== { panel19.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- PasswordField ---- PasswordField.setText("elab@123"); panel19.add(PasswordField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel19, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel20 ======== { panel20.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- textField8 ---- textField8.setText(""); panel20.add(textField8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel20, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel21 ======== { panel21.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label5 ---- label5.setText("\u6570\u636e\u5e93\u9a71\u52a8:"); panel21.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel21, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel22 ======== { panel22.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label6 ---- label6.setText("\u6570\u636e\u5e93\u8fde\u63a5\u5730\u5740:"); panel22.add(label6, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel22, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel23 ======== { panel23.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label7 ---- label7.setText("\u6570\u636e\u5e93\u7528\u6237\u540d:"); panel23.add(label7, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel23, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel24 ======== { panel24.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label8 ---- label8.setText("\u6570\u636e\u5e93\u5bc6\u7801:"); panel24.add(label8, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel24, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); //======== panel25 ======== { panel25.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); //---- label9 ---- label9.setText("\u8868\u540d(\u53ef\u6a21\u7cca%)"); panel25.add(label9, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null)); } panel15.add(panel25, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null)); } scrollPane2.setViewportView(panel15); } panel1.add(scrollPane2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null)); //======== scrollPane3 ======== { scrollPane3.setBorder(new TitledBorder("\u6ce8\u610f\u4e8b\u9879")); //---- jscrollPane1 ---- jscrollPane1.setEditable(true); jscrollPane1.setEnabled(true); jscrollPane1.setText( "\t1.\u8bf7\u4e0d\u8981\u91cd\u590d\u751f\u6210\u540c\u6837\u7684\u6587\u4ef6\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u5939\u4e0b\u3002"); scrollPane3.setViewportView(jscrollPane1); } panel1.add(scrollPane3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null)); } // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.dmrr.asistenciasx.Horarios.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed try {//from www. ja v a 2 s. c om int x = jTableHorarios.getSelectedRow(); if (x == -1) { JOptionPane.showMessageDialog(this, "Seleccione un profesor primero", "Datos incompletos", JOptionPane.WARNING_MESSAGE); return; } Integer idProfesor = Integer .parseInt((String) jTableHorarios.getValueAt(jTableHorarios.getSelectedRow(), 1)); JPasswordField pf = new JPasswordField(); String nip = ""; int okCxl = JOptionPane.showConfirmDialog(null, pf, "Introduzca el NIP del jefe del departamento", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (okCxl == JOptionPane.OK_OPTION) { nip = new String(pf.getPassword()); } else { return; } org.jsoup.Connection.Response respuesta = Jsoup .connect("http://siiauescolar.siiau.udg.mx/wus/gupprincipal.valida_inicio") .data("p_codigo_c", "2225255", "p_clave_c", nip).method(org.jsoup.Connection.Method.POST) .timeout(0).execute(); Document login = respuesta.parse(); String sessionId = respuesta.cookie(getFecha() + "SIIAUSESION"); String sessionId2 = respuesta.cookie(getFecha() + "SIIAUUDG"); Document listaHorarios = Jsoup.connect("http://siiauescolar.siiau.udg.mx/wse/sspsecc.consulta_oferta") .data("ciclop", "201510", "cup", "J", "deptop", "", "codprofp", "" + idProfesor, "ordenp", "0", "mostrarp", "1000", "tipop", "T", "secp", "A", "regp", "T") .userAgent("Mozilla").cookie(getFecha() + "SIIAUSESION", sessionId) .cookie(getFecha() + "SIIAUUDG", sessionId2).timeout(0).post(); Elements tabla = listaHorarios.select("body"); tabla.select("style").remove(); Elements font = tabla.select("font"); font.removeAttr("size"); System.out.println(tabla.html()); JEditorPane jEditorPane = new JEditorPane(); jEditorPane.setEditable(false); HTMLEditorKit kit = new HTMLEditorKit(); jEditorPane.setEditorKit(kit); javax.swing.text.Document doc = kit.createDefaultDocument(); jEditorPane.setDocument(doc); jEditorPane.setText(tabla.html()); JOptionPane.showMessageDialog(null, jEditorPane); } catch (IOException ex) { Logger.getLogger(Horarios.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:BRHInit.java
public void showVPSPrompt(JSONArray vps) throws Exception { vps_list = vps;/*from w ww.jav a2 s . c o m*/ if (vps_list_window == null) { vps_list_window = new JFrame("BRH Console"); vps_list_window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel top_panel = new JPanel(); vps_list_window.getContentPane().add(top_panel); top_panel.setLayout(new BoxLayout(top_panel, BoxLayout.Y_AXIS)); top_panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); Vector values = new Vector(); for (int idx = 0; idx < vps_list.length(); ++idx) { JSONArray row = vps_list.getJSONArray(idx); values.addElement(row.getString(1)); } vps_list_box = new JList(values); top_panel.add(new JScrollPane(vps_list_box)); vps_list_box.setVisibleRowCount(10); JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); JPanel col_panel = new JPanel(); p.add(col_panel); col_panel.setLayout(new BoxLayout(col_panel, BoxLayout.Y_AXIS)); col_panel.add(new JLabel("email")); col_panel.add(Box.createRigidArea(new Dimension(0, 5))); col_panel.add(new JLabel("password")); p.add(Box.createRigidArea(new Dimension(5, 0))); col_panel = new JPanel(); p.add(col_panel); col_panel.setLayout(new BoxLayout(col_panel, BoxLayout.Y_AXIS)); col_panel.add(email = new JTextField(20)); col_panel.add(Box.createRigidArea(new Dimension(0, 5))); col_panel.add(password = new JPasswordField()); top_panel.add(Box.createRigidArea(new Dimension(0, 10))); p = new JPanel(); top_panel.add(p); p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); p.add(Box.createHorizontalGlue()); p.add(vps_list_ok = new JButton("OK")); p.add(Box.createRigidArea(new Dimension(5, 0))); p.add(vps_list_cancel = new JButton("Cancel")); p.add(Box.createHorizontalGlue()); vps_list_ok.addActionListener(this); vps_list_cancel.addActionListener(this); vps_list_window.pack(); } vps_list_window.setVisible(true); }