List of usage examples for com.jgoodies.forms.layout FormLayout FormLayout
public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs)
From source file:anl.verdi.plot.gui.VerticalCrossDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); dialogPane = new JPanel(); contentPanel = new JPanel(); separator1 = compFactory.createSeparator("Select Cross Section"); rbX = new JRadioButton(); lblColumn = new JLabel(); xSpinner = new JSpinner(); rbY = new JRadioButton(); lblRow = new JLabel(); ySpinner = new JSpinner(); separator2 = compFactory.createSeparator(""); buttonBar = new JPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setModal(true);/*from w w w . j a v a 2s . c o m*/ Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { // 2014 ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("max(default;50dlu)"); ColumnSpec bColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec[0], FormFactory.LABEL_COMPONENT_GAP_COLSPEC, bColumnSpec }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // contentPanel.setLayout(new FormLayout( // new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec("max(default;50dlu)"), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) // }, // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); contentPanel.add(separator1, cc.xywh(1, 1, 7, 1)); //---- rbX ---- rbX.setText("X-Axis Cross Section"); contentPanel.add(rbX, cc.xywh(1, 3, 5, 1)); //---- lblColumn ---- lblColumn.setText("Column:"); contentPanel.add(lblColumn, cc.xy(3, 5)); contentPanel.add(xSpinner, cc.xy(5, 5)); //---- rbY ---- rbY.setText("Y-Axis Cross Section"); contentPanel.add(rbY, cc.xywh(1, 7, 5, 1)); //---- lblRow ---- lblRow.setText("Row:"); contentPanel.add(lblRow, cc.xy(3, 9)); contentPanel.add(ySpinner, cc.xy(5, 9)); contentPanel.add(separator2, cc.xywh(1, 11, 7, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); // 2014 RowSpec[] aRowSpec = RowSpec.decodeSpecs("pref"); buttonBar .setLayout( new FormLayout( new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, aRowSpec)); // buttonBar.setLayout(new FormLayout( // new ColumnSpec[] { // FormFactory.GLUE_COLSPEC, // FormFactory.BUTTON_COLSPEC, // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.BUTTON_COLSPEC // }, // RowSpec.decodeSpecs("pref"))); //---- okButton ---- okButton.setText("OK"); buttonBar.add(okButton, cc.xy(2, 1)); //---- cancelButton ---- cancelButton.setText("Cancel"); buttonBar.add(cancelButton, cc.xy(4, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:app.ResumenFactura.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - asd asd label1 = new JLabel(); label2 = new JLabel(); dateChooser1 = new JDateChooser(); label3 = new JLabel(); dateChooser2 = new JDateChooser(); //======== this ======== // JFormDesigner evaluation mark setBorder(/*from w w w . j a v a 2s. co m*/ new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); setLayout(new FormLayout("115dlu, 200dlu, [216dlu,default]", "5*(default, $lgap), default")); //---- label1 ---- label1.setText("LISTADO RESUMEN DE FACTURAS EMITIDAS"); add(label1, CC.xy(2, 3, CC.CENTER, CC.DEFAULT)); //---- label2 ---- label2.setText("Periodo inicio:"); add(label2, CC.xy(1, 7, CC.RIGHT, CC.DEFAULT)); add(dateChooser1, CC.xy(2, 7)); //---- label3 ---- label3.setText("Periodo final:"); add(label3, CC.xy(1, 9, CC.RIGHT, CC.DEFAULT)); add(dateChooser2, CC.xy(2, 9)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:ar.com.tellapic.sumi.test.CreateNewNodeDialog.java
License:Open Source License
/** *//*from www.j ava 2 s . c om*/ private void initComponents() { setModal(true); setIconImage( Toolkit.getDefaultToolkit().getImage(CreateNewNodeDialog.class.getResource("/icons/user.png"))); setBounds(100, 100, 441, 318); setMinimumSize(new Dimension(450, 300)); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); /* Create the form layout */ layout = new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }); /* Set the form layout in the content pane */ contentPanel.setLayout(layout); /* Create a label to show a tip */ JLabel lblTipUseBinds = new JLabel( "Tip: use binds Ctrl+N and Ctrl+R to add or remove column data respectively."); lblTipUseBinds.setFont(new Font("DejaVu Sans", Font.ITALIC, 10)); lblTipUseBinds .setIcon(new ImageIcon(CreateNewNodeDialog.class.getResource("/icons/information-balloon.png"))); /* Add the label to the view */ contentPanel.add(lblTipUseBinds, "2, 2, 6, 1"); /* Create a label for the user field */ JLabel lblUserName = new JLabel("User name:"); /* Add the label to the view */ contentPanel.add(lblUserName, "2, 4, right, default"); /* Create the user field */ userField = new JTextField(); userField.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { newChildButton.setEnabled(userField.getText().length() > 0); // if (node == null) { // node = new GumiNode(userField.getText()); // if (parentNode != null) // parentNode.add(node); // } // else // node.setUserObject(userField.getText()); } }); userField.setColumns(10); /* Add the user field to the view */ contentPanel.add(userField, "4, 4, fill, default"); /* Create the button for adding column data */ /* Add the button to the view */ /* Create a separator */ JButton button = new JButton(); button.setHideActionText(true); button.setAction(newDataAction); contentPanel.add(button, "8, 4"); JSeparator separator = new JSeparator(); /* Add the separator to the view */ contentPanel.add(separator, "2, 6, 5, 1"); /* Create the Button Panel */ JPanel buttonPane = new JPanel(); getContentPane().add(buttonPane, BorderLayout.SOUTH); buttonPane.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("max(4dlu;pref)"), ColumnSpec.decode("100px"), ColumnSpec.decode("4dlu:grow"), FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.PREF_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, }, new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("28px"), })); /* Configure the button for adding childs. Sets its state to disabled */ newChildButton.setAction(newChildAction); newChildButton.setEnabled(false); /* Add the new child button to the button panel */ buttonPane.add(newChildButton, "2, 2, left, top"); /* Create the OK dialog button */ JButton okButton = new JButton("OK"); okButton.setAction(okDialogAction); okButton.setActionCommand("OK"); /* Add the OK dialog button to the button panel */ buttonPane.add(okButton, "4, 2, left, top"); /* Create the Cancel dialgo button */ JButton cancelButton = new JButton("Cancel"); cancelButton.setAction(cancelDialogAction); cancelButton.setActionCommand("Cancel"); /* Add the cancel dialog button to the button panel */ buttonPane.add(cancelButton, "6, 2, right, top"); /* Assign keyboards bindings */ createKeyboardMappings(); /* Request focus */ addComponentListener(new ComponentAdapter() { public void componentShown(ComponentEvent e) { userField.requestFocus(); } }); setFocusTraversalPolicy(new FocusTraversalOnArray( new Component[] { lblUserName, userField, button, buttonPane, okButton, cancelButton })); /* Final configurations */ getRootPane().setDefaultButton(okButton); rowOffset = layout.getRowCount(); }
From source file:at.becast.youploader.gui.EditPanel.java
License:Open Source License
private void initComponents() { JLabel lblTemplate = new JLabel(); cmbTemplate = new JComboBox<Item>(); loadTemplates();//from w ww .j a v a 2 s. co m cmbTemplate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { templateCmbChanged(e); } }); setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("110px"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:max(51dlu;default):grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:max(28dlu;pref):grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("center:max(10dlu;pref):grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("right:30px"), ColumnSpec.decode("2dlu"), ColumnSpec.decode("right:30px"), ColumnSpec.decode("2dlu"), ColumnSpec.decode("right:30px"), }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), RowSpec.decode("1dlu"), RowSpec.decode("20px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("20px"), })); lblTemplate.setText(LANG.getString("EditPanel.Template") + ":"); add(lblTemplate, "2, 2, right, center"); add(cmbTemplate, "4, 2, 5, 1, fill, fill"); JButton btnDeleteTemplate = new JButton(""); btnDeleteTemplate.setToolTipText(LANG.getString("EditPanel.DeleteTemplate")); btnDeleteTemplate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { deleteTemplate(); } }); JButton btnNewTemplate = new JButton(""); btnNewTemplate.setToolTipText(LANG.getString("EditPanel.SaveNewTemplate")); btnNewTemplate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { addTemplate(); } }); JButton btnSaveTemplate = new JButton(""); btnSaveTemplate.setToolTipText(LANG.getString("EditPanel.SaveTemplate")); btnSaveTemplate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { saveTemplate(); } }); btnSaveTemplate.setIcon(new ImageIcon(getClass().getResource("/disk.png"))); add(btnSaveTemplate, "10, 2, fill, fill"); btnNewTemplate.setIcon(new ImageIcon(getClass().getResource("/add.png"))); add(btnNewTemplate, "12, 2, fill, fill"); btnDeleteTemplate.setIcon(new ImageIcon(getClass().getResource("/cross.png"))); add(btnDeleteTemplate, "14, 2, fill, fill"); JLabel lblStartDirectory = new JLabel(LANG.getString("EditPanel.StartDir") + ":"); add(lblStartDirectory, "2, 4, right, center"); txtStartDir = new JTextField(); add(txtStartDir, "4, 4, 5, 1, fill, fill"); txtStartDir.setColumns(10); JButton btnStartDir = new JButton(""); btnStartDir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { NativeJFileChooser chooser = new NativeJFileChooser(); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int returnVal = chooser.showOpenDialog(getParent()); if (returnVal == JFileChooser.APPROVE_OPTION) { txtStartDir.setText(chooser.getSelectedFile().getAbsolutePath().toString()); } } }); btnStartDir.setIcon(new ImageIcon(getClass().getResource("/folder.png"))); add(btnStartDir, "10, 4, fill, fill"); JLabel lblEndDirectory = new JLabel(LANG.getString("EditPanel.EndDir") + ":"); add(lblEndDirectory, "2, 6, right, center"); txtEndDir = new JTextField(); add(txtEndDir, "4, 6, 5, 1, fill, fill"); txtEndDir.setColumns(10); JButton btnEndDir = new JButton(""); btnEndDir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { NativeJFileChooser chooser = new NativeJFileChooser(); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int returnVal = chooser.showOpenDialog(getParent()); if (returnVal == JFileChooser.APPROVE_OPTION) { txtEndDir.setText(chooser.getSelectedFile().getAbsolutePath().toString()); } } }); btnEndDir.setIcon(new ImageIcon(getClass().getResource("/folder.png"))); add(btnEndDir, "10, 6, fill, fill"); JLabel lblVisibility = new JLabel(LANG.getString("EditPanel.Visibility") + ":"); add(lblVisibility, "2, 8, right, default"); dateTimePicker = new DateTimePicker(new Date()); dateTimePicker.setEnabled(false); dateTimePicker.getEditor().setEnabled(false); Calendar calendar = dateTimePicker.getMonthView().getCalendar(); // starting today if we are in a hurry calendar.setTime(new Date()); dateTimePicker.getMonthView().setLowerBound(calendar.getTime()); cmbVisibility = new JComboBox<VisibilityType>(); cmbVisibility.setModel(new DefaultComboBoxModel<VisibilityType>(VisibilityType.values())); add(cmbVisibility, "4, 8, 5, 1, fill, fill"); JLabel lblReleaseAt = new JLabel(LANG.getString("EditPanel.Relase") + ":"); add(lblReleaseAt, "2, 10, right, default"); add(dateTimePicker, "4, 10, 5, 1, fill, fill"); JLabel lblLicense = new JLabel(LANG.getString("EditPanel.License") + ":"); add(lblLicense, "2, 12, right, default"); cmbLicense = new JComboBox<LicenseType>(); cmbLicense.setModel(new DefaultComboBoxModel<LicenseType>(LicenseType.values())); add(cmbLicense, "4, 12, 5, 1, fill, fill"); cmbLicense.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (cmbLicense.getSelectedItem() == LicenseType.CC) { parent.monetisation(true); } else { parent.monetisation(chckbxAgeRestriction.isSelected()); } } }); JLabel lblThumbnail = new JLabel(LANG.getString("EditPanel.Thumbnail") + ":"); add(lblThumbnail, "2, 14, right, default"); txtThumbnail = new JTextField(); txtThumbnail.setDragEnabled(true); txtThumbnail.setDropTarget(new DropTarget() { private static final long serialVersionUID = 8809983794742040683L; public synchronized void drop(DropTargetDropEvent evt) { try { evt.acceptDrop(DnDConstants.ACTION_COPY); @SuppressWarnings("unchecked") List<File> droppedFiles = (List<File>) evt.getTransferable() .getTransferData(DataFlavor.javaFileListFlavor); for (File file : droppedFiles) { if (file.getName().endsWith(".jpg") || file.getName().endsWith(".png") || file.getName().endsWith(".jpeg")) { txtThumbnail.setText(file.getAbsolutePath()); } } } catch (Exception ex) { LOG.error("Error dropping thumbnail", ex); } } }); add(txtThumbnail, "4, 14, 5, 1, fill, fill"); txtThumbnail.setColumns(10); JButton btnThumbnail = new JButton(""); btnThumbnail.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { NativeJFileChooser chooser = new NativeJFileChooser(); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setFileFilter(new FileNameExtensionFilter("Image Files", "jpg", "jpeg", "png")); int returnVal = chooser.showOpenDialog(getParent()); if (returnVal == JFileChooser.APPROVE_OPTION) { txtThumbnail.setText(chooser.getSelectedFile().getAbsolutePath().toString()); } } }); btnThumbnail.setIcon(new ImageIcon(getClass().getResource("/folder.png"))); add(btnThumbnail, "10, 14, fill, fill"); JLabel lblStartUploadAt = new JLabel(LANG.getString("EditPanel.StartUpload") + ":"); add(lblStartUploadAt, "2, 16, right, default"); dateTimePickerStart = new DateTimePicker(new Date()); dateTimePickerStart.getMonthView().setLowerBound(calendar.getTime()); add(dateTimePickerStart, "4, 16, 5, 1, fill, fill"); JLabel lblGameTitle = new JLabel(LANG.getString("EditPanel.Gametitle") + ":"); add(lblGameTitle, "2, 18, right, default"); cmbGameTitle = new AutocompleteComboBox(); add(cmbGameTitle, "4, 18, 5, 1, fill, fill"); JLabel lblAdditionalSettings = new JLabel(LANG.getString("EditPanel.OtherSettings") + ":"); add(lblAdditionalSettings, "2, 20, right, default"); chckbxAllowEmbedding = new JCheckBox(LANG.getString("EditPanel.embedding")); chckbxAllowEmbedding.setToolTipText(LANG.getString("EditPanel.embedding")); add(chckbxAllowEmbedding, "4, 20, 3, 1"); chckbxAgeRestriction = new JCheckBox(LANG.getString("EditPanel.AgeRestriction")); chckbxAgeRestriction.setToolTipText(LANG.getString("EditPanel.AgeRestriction")); chckbxAgeRestriction.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (chckbxAgeRestriction.isSelected()) { parent.monetisation(chckbxAgeRestriction.isSelected()); } else { parent.monetisation(cmbLicense.getSelectedItem() == LicenseType.CC); } } }); add(chckbxAgeRestriction, "8, 20, 3, 1, left, default"); chckbxMakeStatisticsPublic = new JCheckBox(LANG.getString("EditPanel.Statistics")); chckbxMakeStatisticsPublic.setToolTipText(LANG.getString("EditPanel.Statistics")); chckbxMakeStatisticsPublic.setVerticalAlignment(SwingConstants.TOP); add(chckbxMakeStatisticsPublic, "4, 22, 3, 1, fill, default"); chckbxAllowComments = new JCheckBox(LANG.getString("EditPanel.AllowComments")); chckbxAllowComments.setToolTipText(LANG.getString("EditPanel.AllowComments")); chckbxAllowComments.setSelected(true); add(chckbxAllowComments, "8, 22, 3, 1, left, default"); JLabel lblMessage = new JLabel(LANG.getString("EditPanel.Message") + ":"); add(lblMessage, "2, 24, right, default"); JScrollPane scrollPane = new JScrollPane(); add(scrollPane, "4, 24, 5, 7, fill, fill"); txtMessage = new JTextPane(); txtMessage.setFont(new Font("SansSerif", Font.PLAIN, 13)); txtMessage.setEnabled(false); scrollPane.setViewportView(txtMessage); txtMessage.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); lblSociallenght = new JLabel("(0/110)"); add(lblSociallenght, "10, 24, 3, 1"); chckbxGoogle = new JCheckBox("Google+"); chckbxGoogle.setSelected(true); chckbxGoogle.setEnabled(false); add(chckbxGoogle, "2, 26, fill, default"); chckbxTwitter = new JCheckBox("Twitter"); chckbxTwitter.setSelected(true); chckbxTwitter.setEnabled(false); add(chckbxTwitter, "2, 28, fill, default"); chckbxFacebook = new JCheckBox("Facebook"); chckbxFacebook.setSelected(true); chckbxFacebook.setEnabled(false); add(chckbxFacebook, "2, 30, fill, default"); cmbVisibility.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent arg0) { if (cmbVisibility.getSelectedItem() == VisibilityType.SCHEDULED) { setDateEnabled(true); setMessageEnabled(true); } else if (cmbVisibility.getSelectedItem() == VisibilityType.PUBLIC) { setDateEnabled(false); setMessageEnabled(true); } else { setDateEnabled(false); setMessageEnabled(false); } } }); }
From source file:at.becast.youploader.gui.FrmAbout.java
License:Open Source License
/** * Create the dialog.//from ww w . j av a 2s . c om */ public FrmAbout() { setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setResizable(false); setTitle(String.format(LANG.getString("About.title"), Main.APP_NAME)); ResourceBundle bundle = ResourceBundle.getBundle("build"); String rev = bundle.getString("git-sha-1"); String build = bundle.getString("jenkins-build"); this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/yp.png"))); setBounds(100, 100, 500, 397); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("max(166dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("210px:grow"), }, new RowSpec[] { FormSpecs.UNRELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("20px"), FormSpecs.PARAGRAPH_GAP_ROWSPEC, RowSpec.decode("103px"), })); JLabel label = new JLabel(""); label.setHorizontalAlignment(SwingConstants.CENTER); label.setIcon(new ImageIcon(getClass().getResource("/yp.png"))); contentPanel.add(label, "1, 2, 1, 9, left, fill"); JLabel lblYouploader = new JLabel("YouPloader " + Main.VERSION); lblYouploader.setFont(new Font("Arial Black", Font.PLAIN, 11)); contentPanel.add(lblYouploader, "3, 2, left, default"); JLabel lblGenuineparts = new JLabel(" 2016 genuineparts"); lblGenuineparts.setFont(new Font("Arial Black", Font.PLAIN, 11)); contentPanel.add(lblGenuineparts, "3, 4, left, default"); JLabel lblRevision = new JLabel("Revision " + rev); lblRevision.setFont(new Font("Arial", Font.PLAIN, 13)); contentPanel.add(lblRevision, "3, 6"); JLabel lblBuild = new JLabel("Build " + build); lblBuild.setFont(new Font("Arial", Font.PLAIN, 13)); contentPanel.add(lblBuild, "3, 8"); JLabel lblHttpsgithubcombecastyouploader = new JLabel("https://github.com/becast/youploader"); lblHttpsgithubcombecastyouploader.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { DesktopUtil.openBrowser("https://github.com/becast/youploader"); } }); lblHttpsgithubcombecastyouploader.setForeground(Color.BLUE); lblHttpsgithubcombecastyouploader.setFont(new Font("Arial", Font.PLAIN, 13)); contentPanel.add(lblHttpsgithubcombecastyouploader, "3, 10"); JLabel lblCredits = new JLabel("Credits:"); contentPanel.add(lblCredits, "1, 14"); JScrollPane scrollPane = new JScrollPane(); contentPanel.add(scrollPane, "1, 16, 3, 3, fill, fill"); JTextPane txtCredits = new JTextPane(); txtCredits.setText( "Thanks to everyone who contributed!\r\n\r\nGerman Translation\r\nMeduax - https://github.com/Meduax - https://www.youtube.com/user/Meduax\r\n\r\nTesting:\r\nWePlaydThis\r\n@WePlaydThis\r\nhttps://www.youtube.com/user/WePlaydThis\r\n\r\nTheJessaChannel\r\n@TheJessaChannel\r\nhttps://www.youtube.com/user/TheJessaChannel\r\n\r\nThe kind people of /r/letsplay\r\n"); txtCredits.setCaretPosition(0); txtCredits.setEditable(false); scrollPane.setViewportView(txtCredits); { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton okButton = new JButton("OK"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButton(); } }); okButton.setActionCommand("OK"); buttonPane.add(okButton); getRootPane().setDefaultButton(okButton); } } }
From source file:at.becast.youploader.gui.FrmMain.java
License:Open Source License
public void initMainTab() { cmbCategory = new JComboBox<Categories>(); cmbCategory.setModel(new DefaultComboBoxModel<Categories>(Categories.values())); SideBar sideBar = new SideBar(SideBar.SideBarMode.TOP_LEVEL, true, 300, true); ss1 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Settings"), new EditPanel(this), new ImageIcon(getClass().getResource("/pencil.png"))); ss2 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Playlists"), new PlaylistPanel(this), new ImageIcon(getClass().getResource("/layers.png"))); ss3 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Monetisation"), new MonetPanel(), new ImageIcon(getClass().getResource("/money.png"))); sideBar.addSection(ss1, false);/*from w w w . j av a 2 s .com*/ sideBar.addSection(ss2); sideBar.addSection(ss3); JPanel mainTab = new JPanel(); JPanel panel = new JPanel(); GroupLayout mainTabLayout = new GroupLayout(mainTab); mainTabLayout.setHorizontalGroup(mainTabLayout.createParallelGroup(Alignment.TRAILING) .addGroup(mainTabLayout.createSequentialGroup() .addComponent(panel, GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(sideBar, GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE))); mainTabLayout.setVerticalGroup(mainTabLayout.createParallelGroup(Alignment.LEADING) .addComponent(panel, GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE) .addGroup(mainTabLayout.createSequentialGroup() .addComponent(sideBar, GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE).addContainerGap())); panel.setLayout(new FormLayout( new ColumnSpec[] { ColumnSpec.decode("2px"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("20px:grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("23px"), ColumnSpec.decode("33px"), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("61px"), FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("24px"), ColumnSpec.decode("28px"), ColumnSpec.decode("40px"), ColumnSpec.decode("36px"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("28px"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("58px"), }, new RowSpec[] { RowSpec.decode("2px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("14px"), RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("14px"), RowSpec.decode("25px"), FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("14px"), RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("64dlu:grow"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("max(64dlu;default)"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("25px"), FormSpecs.PARAGRAPH_GAP_ROWSPEC, RowSpec.decode("24px"), RowSpec.decode("23px"), })); lbltitlelenght = new JLabel("(0/100)"); panel.add(lbltitlelenght, "14, 6, 3, 1, right, top"); txtTitle = new JTextField(); contextMenu.add(txtTitle); panel.add(txtTitle, "3, 7, 14, 1, fill, fill"); txtTitle.setColumns(10); txtTitle.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); JLabel lblCategory = new JLabel(LANG.getString("frmMain.Category")); panel.add(lblCategory, "3, 9, 4, 1, left, bottom"); panel.add(cmbCategory, "3, 10, 14, 1, fill, fill"); JLabel lblDescription = new JLabel(LANG.getString("frmMain.Description")); panel.add(lblDescription, "3, 12, 4, 1, left, bottom"); lblDesclenght = new JLabel("(0/5000)"); panel.add(lblDesclenght, "14, 12, 3, 1, right, bottom"); JScrollPane DescriptionScrollPane = new JScrollPane(); panel.add(DescriptionScrollPane, "3, 13, 14, 1, fill, fill"); txtDescription = new JTextArea(); contextMenu.add(txtDescription); txtDescription.setFont(new Font("SansSerif", Font.PLAIN, 13)); DescriptionScrollPane.setViewportView(txtDescription); txtDescription.setWrapStyleWord(true); txtDescription.setLineWrap(true); txtDescription.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); JLabel lblTags = new JLabel(LANG.getString("frmMain.Tags")); panel.add(lblTags, "3, 15, 4, 1, left, bottom"); lblTagslenght = new JLabel("(0/500)"); panel.add(lblTagslenght, "14, 15, 3, 1, right, top"); JScrollPane TagScrollPane = new JScrollPane(); panel.add(TagScrollPane, "3, 16, 14, 1, fill, fill"); txtTags = new JTextArea(); contextMenu.add(txtTags); txtTags.setFont(new Font("SansSerif", Font.PLAIN, 13)); TagScrollPane.setViewportView(txtTags); txtTags.setWrapStyleWord(true); txtTags.setLineWrap(true); txtTags.setBorder(BorderFactory.createEtchedBorder()); txtTags.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { calcNotifies(); } }); JLabel lblAccount = new JLabel(LANG.getString("frmMain.Account")); panel.add(lblAccount, "3, 18, 4, 1, left, bottom"); cmbAccount = new JComboBox<AccountType>(); panel.add(getCmbAccount(), "3, 19, 14, 1, fill, fill"); cmbAccount.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { changeUser(); } }); btnAddToQueue = new JButton(LANG.getString("frmMain.addtoQueue")); btnAddToQueue.setEnabled(false); panel.add(btnAddToQueue, "3, 21, 6, 1, fill, fill"); btnAddToQueue.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { queueButton(); } }); JLabel lblSelectVideo = new JLabel(); panel.add(lblSelectVideo, "3, 3, 4, 1, left, bottom"); lblSelectVideo.setText(LANG.getString("frmMain.selectVideoFile")); cmbFile = new JComboBox<String>(); cmbFile.setDropTarget(new DropTarget() { private static final long serialVersionUID = 8809983794742040683L; public synchronized void drop(DropTargetDropEvent evt) { try { evt.acceptDrop(DnDConstants.ACTION_COPY); @SuppressWarnings("unchecked") List<File> droppedFiles = (List<File>) evt.getTransferable() .getTransferData(DataFlavor.javaFileListFlavor); for (File file : droppedFiles) { cmbFile.removeAllItems(); cmbFile.addItem(file.getAbsolutePath()); } } catch (Exception ex) { LOG.error("Error dropping video file", ex); } } }); panel.add(cmbFile, "3, 4, 14, 1, fill, fill"); JButton btnSelectMovie = new JButton(); btnSelectMovie.setToolTipText("Select Video File"); panel.add(btnSelectMovie, "18, 4, center, top"); btnSelectMovie.setIcon(new ImageIcon(getClass().getResource("/film_add.png"))); JLabel lblTitle = new JLabel(LANG.getString("frmMain.Title")); panel.add(lblTitle, "3, 6, 4, 1, left, bottom"); JButton btnReset = new JButton(LANG.getString("frmMain.Reset")); btnReset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { resetEdit(); } }); panel.add(btnReset, "11, 21, 6, 1, fill, fill"); btnSelectMovie.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { EditPanel edit = (EditPanel) ss1.contentPane; NativeJFileChooser chooser; if (edit.getTxtStartDir() != null && !edit.getTxtStartDir().equals("")) { chooser = new NativeJFileChooser(edit.getTxtStartDir().getText().trim()); } else { chooser = new NativeJFileChooser(); } int returnVal = chooser.showOpenDialog((Component) self); if (returnVal == JFileChooser.APPROVE_OPTION) { cmbFile.removeAllItems(); cmbFile.addItem(chooser.getSelectedFile().getAbsolutePath().toString()); } } }); mainTab.setLayout(mainTabLayout); mainTab.revalidate(); mainTab.repaint(); TabbedPane.addTab(LANG.getString("frmMain.Tabs.VideoSettings"), mainTab); }
From source file:at.becast.youploader.gui.FrmMain.java
License:Open Source License
public void initQueuetab() { JScrollPane TabQueues = new JScrollPane(); QueuePanel = new JPanel(); TabQueues.setViewportView(QueuePanel); QueuePanel.setLayout(new MigLayout("", "[875px,grow,fill]", "[][][][]")); JPanel buttonPanel = new JPanel(); GridBagConstraints gbc_panel_2 = new GridBagConstraints(); gbc_panel_2.fill = GridBagConstraints.BOTH; gbc_panel_2.gridx = 0;/* w w w.j a v a 2 s .c o m*/ gbc_panel_2.gridy = 1; buttonPanel.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(39dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(92dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(46dlu;min)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:max(22dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("max(0dlu;default)"), })); JButton btnStart = new JButton(LANG.getString("frmMain.start")); btnStart.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { startUploads(); } }); JLabel lblAfterUploadsFinish = new JLabel(LANG.getString("frmMain.afterfinish")); buttonPanel.add(lblAfterUploadsFinish, "10, 2, 7, 1"); buttonPanel.add(btnStart, "2, 4"); JButton btnStop = new JButton(LANG.getString("frmMain.stop")); btnStop.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { UploadMgr.stop(); } }); buttonPanel.add(btnStop, "6, 4"); cmbAfterFinish = new JComboBox<Object>(); cmbAfterFinish.setModel(new DefaultComboBoxModel<Object>(new String[] { LANG.getString("frmMain.afterfinish.donothing"), LANG.getString("frmMain.afterfinish.suspend"), LANG.getString("frmMain.afterfinish.shutdown") })); buttonPanel.add(cmbAfterFinish, "10, 4, 7, 1, fill, default"); JLabel lblUploads = new JLabel(LANG.getString("frmMain.uploads") + ":"); buttonPanel.add(lblUploads, "18, 4, right, fill"); JSlider slider = new JSlider(); slider.setPaintTicks(true); slider.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { JSlider s = (JSlider) evt.getSource(); UploadMgr.setUploadlimit(s.getValue()); } }); slider.setMajorTickSpacing(1); slider.setMinorTickSpacing(1); slider.setMinimum(1); slider.setMaximum(5); slider.setValue(1); slider.setSnapToTicks(true); slider.setPaintLabels(true); buttonPanel.add(slider, "20, 4, fill, fill"); JLabel lblUploadSpeed = new JLabel(LANG.getString("frmMain.uploadspeed") + ":"); lblUploadSpeed.setHorizontalAlignment(SwingConstants.TRAILING); buttonPanel.add(lblUploadSpeed, "24, 4"); spinner = new JSpinner(); spinner.setModel(new SpinnerNumberModel(new Integer(0), new Integer(0), null, new Integer(10))); spinner.setEditor(new SpeedValuesSpinnerEditor(spinner)); spinner.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { JSpinner s = (JSpinner) e.getSource(); speed = Integer.parseInt(s.getValue().toString()); Main.s.put("speed", String.valueOf(speed)); UploadMgr.setLimit(speed); } }); spinner.setValue(speed); buttonPanel.add(spinner, "26, 4"); JLabel lblKbps = new JLabel("kbps"); buttonPanel.add(lblKbps, "28, 4"); JPanel TabQueue = new JPanel(); TabbedPane.addTab(LANG.getString("frmMain.Tabs.Queue"), null, TabQueue, null); TabQueue.setLayout(new BorderLayout(0, 0)); TabQueue.add(buttonPanel, BorderLayout.SOUTH); TabQueue.add(TabQueues, BorderLayout.CENTER); }
From source file:at.becast.youploader.gui.ModalDialog.java
License:Open Source License
/** * Create the dialog.// w ww.ja v a 2 s.c o m * * @param code * @throws IOException * @throws InterruptedException */ public ModalDialog(Frame parent, Account Acc, String code, AddAccount accd) { super(parent); setTitle("Linking YouTube Account"); setAlwaysOnTop(true); setModal(true); setResizable(false); setBounds(100, 100, 551, 401); getContentPane().setLayout(new BorderLayout()); this.accd = accd; contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); setModalityType(ModalityType.DOCUMENT_MODAL); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("535px:grow"), }, new RowSpec[] { FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("14px"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("294px"), })); { JButton btnNewButton = new JButton("Open Browser to http://google.com/device"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Browser browser = new Browser(Acc, true); browser.setVisible(true); browser.loadURL("https://google.com/device"); } }); contentPanel.add(btnNewButton, "2, 4, center, default"); } { JLabel lblNewLabel = new JLabel("A Browser should have opened! If not please click the Button below."); lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); contentPanel.add(lblNewLabel, "2, 2, fill, top"); } { JLabel lblNewLabel_1 = new JLabel("Please enter the following code:"); lblNewLabel_1.setHorizontalAlignment(SwingConstants.CENTER); contentPanel.add(lblNewLabel_1, "2, 6, fill, default"); } { check_label = new JLabel(""); check_label.setHorizontalAlignment(SwingConstants.CENTER); check_label.setIcon(new ImageIcon(getClass().getResource("/load_icon.gif"))); contentPanel.add(check_label, "2, 8, fill, top"); } { labelcode = new JTextField(); labelcode.setText(code); labelcode.setHorizontalAlignment(SwingConstants.CENTER); labelcode.setFont(new Font("Tahoma", Font.BOLD, 19)); contentPanel.add(labelcode, "2, 10, fill, fill"); labelcode.setColumns(10); } { JLabel lblThisWindowWill = new JLabel( "This window will close as soon as the Account is successfully linked"); lblThisWindowWill.setHorizontalAlignment(SwingConstants.CENTER); contentPanel.add(lblThisWindowWill, "2, 12"); } { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton cancelButton = new JButton(LANG.getString("Button.cancel")); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { accd.cancel(); close(); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } }
From source file:at.becast.youploader.gui.MonetPanel.java
License:Open Source License
private void initComponents() { setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(80dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("80dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, })); chckbxOverlayads = new JCheckBox(LANG.getString("MonetPanel.Overlayads")); chckbxOverlayads.setEnabled(false);/*from ww w. j a v a2 s . c om*/ add(chckbxOverlayads, "2, 4"); chckbxSponsoredCards = new JCheckBox(LANG.getString("MonetPanel.SponsoredCards")); chckbxSponsoredCards.setEnabled(false); add(chckbxSponsoredCards, "4, 4"); chckbxSkippableVideoads = new JCheckBox(LANG.getString("MonetPanel.Videoads")); chckbxSkippableVideoads.setEnabled(false); add(chckbxSkippableVideoads, "6, 4"); JLabel lblContentSyndication = new JLabel(LANG.getString("MonetPanel.Syndication")); add(lblContentSyndication, "2, 6"); cmbContentSyndication = new JComboBox<SyndicationType>(); cmbContentSyndication.setModel(new DefaultComboBoxModel<SyndicationType>(SyndicationType.values())); add(cmbContentSyndication, "2, 8, 5, 1, fill, fill"); chckbxMonetize = new JCheckBox(LANG.getString("MonetPanel.Monetize")); chckbxMonetize.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { if (chckbxMonetize.isSelected()) { chckbxOverlayads.setEnabled(true); chckbxSkippableVideoads.setEnabled(true); chckbxSponsoredCards.setEnabled(true); } else { chckbxOverlayads.setEnabled(false); chckbxSkippableVideoads.setEnabled(false); chckbxSponsoredCards.setEnabled(false); } } }); add(chckbxMonetize, "2, 2"); chckbxProductplacement = new JCheckBox(LANG.getString("MonetPanel.ProductPlacement")); add(chckbxProductplacement, "2, 10, 5, 1"); }
From source file:at.becast.youploader.gui.PlaylistPanel.java
License:Open Source License
private void initComponents() { setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(105dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(24dlu;default)"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("right:max(70dlu;default)"), }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("max(204dlu;default):grow"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, })); JScrollPane scrollPane = new JScrollPane(); add(scrollPane, "2, 2, 7, 1, fill, fill"); scrollPane.setViewportView(playlistPanel); playlistPanel.setLayout(new GridLayout(0, 1, 0, 0)); JButton btnGetPlaylists = new JButton(""); btnGetPlaylists.setIcon(new ImageIcon(getClass().getResource("/arrow_refresh.png"))); btnGetPlaylists.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PlaylistUpdater pu = new PlaylistUpdater(parent); Thread updater = new Thread(pu); updater.start();//from www .j av a 2s .co m } }); add(btnGetPlaylists, "6, 4, fill, fill"); JButton btnAddPlaylist = new JButton("Add Playlist"); btnAddPlaylist.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addPlaylist(); } }); btnAddPlaylist.setIcon(new ImageIcon(getClass().getResource("/add.png"))); add(btnAddPlaylist, "8, 4, fill, center"); }