List of usage examples for java.awt Insets Insets
public Insets(int top, int left, int bottom, int right)
From source file:io.github.tavernaextras.biocatalogue.integration.config.BioCataloguePluginConfigurationPanel.java
private void initialiseUI() { this.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.NORTHWEST; c.weightx = 1.0;//from w w w. j a v a 2 s . com c.gridx = 0; c.gridy = 0; JTextArea taDescription = new JTextArea("Configure the Service Catalogue integration functionality"); taDescription.setFont(taDescription.getFont().deriveFont(Font.PLAIN, 11)); taDescription.setLineWrap(true); taDescription.setWrapStyleWord(true); taDescription.setEditable(false); taDescription.setFocusable(false); taDescription.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.add(taDescription, c); c.gridy++; c.insets = new Insets(20, 0, 0, 0); JLabel jlBioCatalogueAPIBaseURL = new JLabel("Base URL of the Service Catalogue instance to connect to:"); this.add(jlBioCatalogueAPIBaseURL, c); c.gridy++; c.insets = new Insets(0, 0, 0, 0); tfBioCatalogueAPIBaseURL = new JTextField(); this.add(tfBioCatalogueAPIBaseURL, c); c.gridy++; c.insets = new Insets(30, 0, 0, 0); // We are not removing BioCatalogue services from its config panel any more - // they are being handled by the Taverna's Service Registry // JButton bForgetStoredServices = new JButton("Forget services added to Service Panel by BioCatalogue Plugin"); // bForgetStoredServices.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent e) // { // int response = JOptionPane.showConfirmDialog(null, // no way T2ConfigurationFrame instance can be obtained to be used as a parent... // "Are you sure you want to clear all SOAP operations and REST methods\n" + // "that were added to the Service Panel by the BioCatalogue Plugin?\n\n" + // "This action is permanent is cannot be undone.\n\n" + // "Do you want to proceed?", "BioCatalogue Plugin", JOptionPane.YES_NO_OPTION); // // if (response == JOptionPane.YES_OPTION) // { // BioCatalogueServiceProvider.clearRegisteredServices(); // JOptionPane.showMessageDialog(null, // no way T2ConfigurationFrame instance can be obtained to be used as a parent... // "Stored services have been successfully cleared, but will remain\n" + // "being shown in Service Panel during this session.\n\n" + // "They will not appear in the Service Panel after you restart Taverna.", // "BioCatalogue Plugin", JOptionPane.INFORMATION_MESSAGE); // } // } // }); // this.add(bForgetStoredServices, c); JButton bLoadDefaults = new JButton("Load Defaults"); bLoadDefaults.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { loadDefaults(); } }); JButton bReset = new JButton("Reset"); bReset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { resetFields(); } }); JButton bApply = new JButton("Apply"); bApply.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { applyChanges(); } }); JPanel jpActionButtons = new JPanel(); jpActionButtons.add(bLoadDefaults); jpActionButtons.add(bReset); jpActionButtons.add(bApply); c.insets = new Insets(30, 0, 0, 0); c.gridy++; c.weighty = 1.0; this.add(jpActionButtons, c); }
From source file:net.chaosserver.timelord.swingui.TaskDayPanel.java
/** * Builds the panel. This uses a GridBag to try and make formatting * grid-like between the unconnected rows. *///from w ww .j a v a 2 s. c om protected void buildPanel() { GridBagLayout gridBagLayout = new GridBagLayout(); GridBagConstraints gridBagConstraints = new GridBagConstraints(); Insets defaultInsets = gridBagConstraints.insets; setLayout(gridBagLayout); taskName = new JLabel(); if (timelordTask.isHidden()) { Font taskFont = taskName.getFont(); Font italicFont = new Font(taskFont.getName(), Font.ITALIC, taskFont.getSize()); taskName.setFont(italicFont); } updateTaskNameLabel(); gridBagConstraints.anchor = GridBagConstraints.WEST; gridBagConstraints.weightx = LayoutConstants.HEAVY_WEIGHT; gridBagConstraints.insets = new Insets(0, LayoutConstants.SMALL_INSET, 0, LayoutConstants.BIG_INSET); gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagLayout.addLayoutComponent(taskName, gridBagConstraints); add(taskName); minusButton = new JButton("-" + DateUtil.getSmallestTimeInMinutes() + "m"); minusButton.setToolTipText("Remove 15 minutes (0.25 hours) " + "of time from this task."); minusButton.setActionCommand(ACTION_MINUS_15); minusButton.addActionListener(this); gridBagConstraints.anchor = GridBagConstraints.CENTER; gridBagConstraints.insets = defaultInsets; gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.weightx = 0; gridBagLayout.addLayoutComponent(minusButton, gridBagConstraints); add(minusButton); addButton = new JButton("+" + DateUtil.getSmallestTimeInMinutes() + "m"); addButton.setToolTipText("Add 15 minutes (0.25 hours) of " + "time from this task."); addButton.setActionCommand(ACTION_ADD_15); addButton.addActionListener(this); gridBagConstraints.anchor = GridBagConstraints.CENTER; gridBagConstraints.insets = defaultInsets; gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.weightx = 0; gridBagLayout.addLayoutComponent(addButton, gridBagConstraints); add(addButton); timeLabel = new JLabel(); if (todayTaskDay != null) { timeLabel.setText(DateUtil.formatHours(null, todayTaskDay.getHours())); } else { timeLabel.setText(DateUtil.formatHours(null, 0)); } gridBagConstraints.anchor = GridBagConstraints.EAST; gridBagConstraints.fill = GridBagConstraints.NONE; gridBagConstraints.weightx = 0; gridBagConstraints.insets = new Insets(0, LayoutConstants.BIG_INSET, 0, LayoutConstants.SMALL_INSET); gridBagLayout.addLayoutComponent(timeLabel, gridBagConstraints); add(timeLabel); enabledButtons(); }
From source file:rhinova.gui.dataentry.link.LinkDataEntryPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license vSpacer5 = new JPanel(null); label2 = new JLabel(); hSpacer1 = new JPanel(null); label1 = new JLabel(); txtName = new JTextField(); vSpacer4 = new JPanel(null); label6 = new JLabel(); txtCap = new JTextField(); vSpacer3 = new JPanel(null); label7 = new JLabel(); txtSur = new JTextField(); hSpacer2 = new JPanel(null); vSpacer2 = new JPanel(null); label8 = new JLabel(); res1 = new JComboBox(); vSpacer1 = new JPanel(null); label9 = new JLabel(); res2 = new JComboBox(); vSpacer6 = new JPanel(null); btnCreate = new JButton(); hSpacer3 = new JPanel(null); //======== this ======== setLayout(new GridBagLayout()); ((GridBagLayout) getLayout()).columnWidths = new int[] { 0, 65, 145, 0, 0 }; ((GridBagLayout) getLayout()).rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ((GridBagLayout) getLayout()).columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0E-4 }; ((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, 1.0E-4 }; add(vSpacer5, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- label2 ---- label2.setText("Link Entry Panel"); label2.setFont(new Font("Tahoma", Font.PLAIN, 16)); add(label2, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(hSpacer1, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- label1 ---- label1.setText("name"); add(label1, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(txtName, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(vSpacer4, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- label6 ---- label6.setText("capacity"); add(label6, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(txtCap, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(vSpacer3, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- label7 ---- label7.setText("survival rate"); add(label7, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(txtSur, new GridBagConstraints(2, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(hSpacer2, new GridBagConstraints(3, 6, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 0), 0, 0)); add(vSpacer2, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- label8 ---- label8.setText("reserve1"); add(label8, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(res1, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(vSpacer1, new GridBagConstraints(1, 9, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- label9 ---- label9.setText("reserve2"); add(label9, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(res2, new GridBagConstraints(2, 10, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(vSpacer6, new GridBagConstraints(1, 11, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); //---- btnCreate ---- btnCreate.setText("Create Link"); btnCreate.addActionListener(new ActionListener() { @Override/*from www . j a v a2s .co m*/ public void actionPerformed(ActionEvent e) { btnCreateActionPerformed(e); } }); add(btnCreate, new GridBagConstraints(2, 12, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); add(hSpacer3, new GridBagConstraints(2, 13, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.game.ui.views.ItemPanel.java
public void doCommonStuffForContent() { JPanel panel1 = new JPanel(); panel1.setAlignmentX(0);//from w ww. java2 s . c o m panel1.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel1.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.NORTHWEST; c.insets = new Insets(5, 5, 5, 5); c.weightx = 1; c.weighty = 0.2; c.gridwidth = 2; JLabel dtlLbl = new JLabel(type + "Details : "); dtlLbl.setFont(new Font("Times New Roman", Font.BOLD, 15)); panel1.add(dtlLbl, c); c.gridwidth = 1; c.gridy = 1; JLabel nameLbl = new JLabel("Name : "); panel1.add(nameLbl, c); c.gridx = 1; JTextField name = new JTextField(""); name.setColumns(20); panel1.add(name, c); if (ringPanel) { createComponentsForRing(panel1, c); } else if (armourPanel) { createComponentsForArmour(panel1, c); } else if (potionPanel) { createComponentsForPotion(panel1, c); } else if (treasurePanel) { createComponentsForTreasure(panel1, c); } c.gridx = 0; c.gridy = c.gridy + 1; c.gridwidth = 2; JButton submit = new JButton("Save"); submit.addActionListener(this); submit.setActionCommand("button"); panel1.add(submit, c); c.gridx = 0; c.gridy = c.gridy + 1; c.gridwidth = 2; c.weighty = 0; c.weightx = 1; validationMess = new JLabel("Pls enter all the fields or pls choose a " + type + " from the drop down"); validationMess.setForeground(Color.red); validationMess.setVisible(false); panel1.add(validationMess, c); c.gridy++; c.weighty = 1; c.weightx = 1; panel1.add(new JPanel(), c); panel1.setBorder(LineBorder.createGrayLineBorder()); add(panel1); add(Box.createVerticalGlue()); }
From source file:com.sshtools.common.ui.SshToolsConnectionHostTab.java
/** * Creates a new SshToolsConnectionHostTab object. *//*from w w w. ja va 2 s .c o m*/ public SshToolsConnectionHostTab() { super(); // Create the main connection details panel JPanel mainConnectionDetailsPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.insets = new Insets(0, 2, 2, 2); gbc.weightx = 1.0; // Host name UIUtil.jGridBagAdd(mainConnectionDetailsPanel, new JLabel("Hostname"), gbc, GridBagConstraints.REMAINDER); gbc.fill = GridBagConstraints.HORIZONTAL; UIUtil.jGridBagAdd(mainConnectionDetailsPanel, jTextHostname, gbc, GridBagConstraints.REMAINDER); gbc.fill = GridBagConstraints.NONE; // Port UIUtil.jGridBagAdd(mainConnectionDetailsPanel, new JLabel("Port"), gbc, GridBagConstraints.REMAINDER); UIUtil.jGridBagAdd(mainConnectionDetailsPanel, jTextPort, gbc, GridBagConstraints.REMAINDER); // Username UIUtil.jGridBagAdd(mainConnectionDetailsPanel, new JLabel("Username"), gbc, GridBagConstraints.REMAINDER); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weighty = 1.0; UIUtil.jGridBagAdd(mainConnectionDetailsPanel, jTextUsername, gbc, GridBagConstraints.REMAINDER); gbc.fill = GridBagConstraints.NONE; // IconWrapperPanel iconMainConnectionDetailsPanel = new IconWrapperPanel( new ResourceIcon(SshToolsConnectionHostTab.class, CONNECT_ICON), mainConnectionDetailsPanel); // Authentication methods panel JPanel authMethodsPanel = new JPanel(new GridBagLayout()); authMethodsPanel.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0)); gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.insets = new Insets(2, 2, 2, 2); gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 2; GridBagConstraints gbc2 = new GridBagConstraints(); gbc2.fill = GridBagConstraints.HORIZONTAL; gbc2.anchor = GridBagConstraints.NORTHWEST; gbc2.insets = new Insets(2, 2, 2, 2); gbc2.weightx = 1.0; gbc2.weighty = 0.0; gbc2.gridx = 0; gbc2.gridy = 1; gbc2.gridwidth = 2; GridBagConstraints gbc3 = new GridBagConstraints(); gbc3.fill = GridBagConstraints.HORIZONTAL; gbc3.anchor = GridBagConstraints.NORTHWEST; gbc3.insets = new Insets(2, 2, 2, 2); gbc3.weightx = 1.0; gbc3.weighty = 0.0; gbc3.gridx = 0; gbc3.gridy = 2; gbc3.gridwidth = 2; GridBagConstraints gbc4 = new GridBagConstraints(); gbc4.fill = GridBagConstraints.HORIZONTAL; gbc4.anchor = GridBagConstraints.NORTHWEST; gbc4.insets = new Insets(26, 2, 2, 2); gbc4.weightx = 0.0; gbc4.weighty = 0.0; gbc4.gridx = 0; gbc4.gridy = 3; gbc4.gridwidth = 1; GridBagConstraints gbc5 = new GridBagConstraints(); gbc5.fill = GridBagConstraints.NONE; gbc5.anchor = GridBagConstraints.WEST; gbc5.insets = new Insets(26, 2, 2, 2); gbc5.weightx = 1.0; gbc5.weighty = 0.0; gbc5.gridx = 1; gbc5.gridy = 3; gbc5.gridwidth = 1; GridBagConstraints gbc6 = new GridBagConstraints(); gbc6.fill = GridBagConstraints.HORIZONTAL; gbc6.anchor = GridBagConstraints.NORTHWEST; gbc6.insets = new Insets(12, 2, 2, 2); gbc6.weightx = 0.0; gbc6.weighty = 0.0; gbc6.gridx = 0; gbc6.gridy = 4; gbc6.gridwidth = 1; GridBagConstraints gbc7 = new GridBagConstraints(); gbc7.fill = GridBagConstraints.NONE; gbc7.anchor = GridBagConstraints.WEST; gbc7.insets = new Insets(12, 2, 2, 2); gbc7.weightx = 1.0; gbc7.weighty = 0.0; gbc7.gridx = 1; gbc7.gridy = 4; gbc7.gridwidth = 1; GridBagConstraints gbc8 = new GridBagConstraints(); gbc8.fill = GridBagConstraints.HORIZONTAL; gbc8.anchor = GridBagConstraints.NORTHWEST; gbc8.insets = new Insets(12, 2, 2, 2); gbc8.weightx = 0.0; gbc8.weighty = 0.0; gbc8.gridx = 0; gbc8.gridy = 5; gbc8.gridwidth = 1; GridBagConstraints gbc9 = new GridBagConstraints(); gbc9.fill = GridBagConstraints.NONE; gbc9.anchor = GridBagConstraints.WEST; gbc9.insets = new Insets(12, 2, 2, 2); gbc9.weightx = 1.0; gbc9.weighty = 0.0; gbc9.gridx = 1; gbc9.gridy = 5; gbc9.gridwidth = 1; GridBagConstraints gbc10 = new GridBagConstraints(); gbc10.fill = GridBagConstraints.HORIZONTAL; gbc10.anchor = GridBagConstraints.NORTHWEST; gbc10.insets = new Insets(26, 2, 2, 2); gbc10.weightx = 1.0; gbc10.weighty = 0.0; gbc10.gridx = 0; gbc10.gridy = 6; gbc10.gridwidth = 2; // Authentication methods authMethodsPanel.add(new JLabel("Authentication Methods"), gbc); jListAuths.setVisibleRowCount(5); authMethodsPanel.add(new JScrollPane(jListAuths), gbc2); allowAgentForwarding = new JCheckBox("Allow agent forwarding"); authMethodsPanel.add(allowAgentForwarding, gbc3); String options[] = { "Full", "Limited", "None" }; delegationOption = new JComboBox(options); delegationOption.setSelectedIndex(0); authMethodsPanel.add(new JLabel("Delegation Type:"), gbc4); authMethodsPanel.add(delegationOption, gbc5); String optionsP[] = { "Pre-RFC Impersonation", "RFC Impersonation", "Legacy" }; proxyOption = new JComboBox(optionsP); proxyOption.setSelectedIndex(0); authMethodsPanel.add(new JLabel("Proxy Type:"), gbc6); authMethodsPanel.add(proxyOption, gbc7); authMethodsPanel.add(new JLabel("Proxy Lifetime (hours):"), gbc8); proxyLength.setColumns(5); authMethodsPanel.add(proxyLength, gbc9); gbc.gridx = 0; proxySave = new JCheckBox("Save Grid Proxies to Disk"); authMethodsPanel.add(proxySave, gbc10); // IconWrapperPanel iconAuthMethodsPanel = new IconWrapperPanel( new ResourceIcon(SshToolsConnectionHostTab.class, AUTH_ICON), authMethodsPanel); // This panel JPanel mine = new JPanel(); mine.setLayout(new GridBagLayout()); mine.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.NORTH; gbc.insets = new Insets(2, 2, 2, 2); gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.gridx = 0; gbc.gridy = 0; mine.add(iconMainConnectionDetailsPanel, gbc); gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.NORTH; gbc.weightx = 1.0; gbc.weighty = 0.0; gbc.gridx = 0; gbc.gridy = 1; gbc.insets = new Insets(20, 2, 2, 2); mine.add(iconAuthMethodsPanel, gbc); setLayout(new BorderLayout()); setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.add(mine, BorderLayout.NORTH); // Set up the values in the various components addAuthenticationMethods(); }
From source file:ShowDocument.java
public URLWindow(AppletContext appletContext) { super("Show a Document!"); this.appletContext = appletContext; JPanel contentPane = new JPanel(new GridBagLayout()); setContentPane(contentPane);// w ww . ja v a 2 s . co m contentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; JLabel label1 = new JLabel("URL of document to show: ", JLabel.TRAILING); add(label1, c); urlField = new JTextField("http://java.sun.com/", 20); label1.setLabelFor(urlField); urlField.addActionListener(this); c.gridwidth = GridBagConstraints.REMAINDER; c.weightx = 1.0; add(urlField, c); JLabel label2 = new JLabel("Window/frame to show it in: ", JLabel.TRAILING); c.gridwidth = 1; c.weightx = 0.0; add(label2, c); String[] strings = { "(browser's choice)", //don't specify "My Personal Window", //a window named "My Personal Window" "_blank", //a new, unnamed window "_self", "_parent", "_top" //the Frame that contained this applet }; choice = new JComboBox(strings); label2.setLabelFor(choice); c.fill = GridBagConstraints.NONE; c.gridwidth = GridBagConstraints.REMAINDER; c.insets = new Insets(5, 0, 0, 0); c.anchor = GridBagConstraints.LINE_START; add(choice, c); JButton button = new JButton("Show document"); button.addActionListener(this); c.weighty = 1.0; c.ipadx = 10; c.ipady = 10; c.insets = new Insets(10, 0, 0, 0); c.anchor = GridBagConstraints.PAGE_END; add(button, c); }
From source file:com.microsoft.alm.plugin.idea.common.ui.common.forms.TfsLoginForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/*ww w . jav a2 s.c om*/ */ private void $$$setupUI$$$() { createUIComponents(); contentPanel = new JPanel(); contentPanel.setLayout(new GridLayoutManager(7, 5, new Insets(0, 0, 0, 0), -1, -1)); final Spacer spacer1 = new Spacer(); contentPanel.add(spacer1, new GridConstraints(6, 1, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); headerLabel = new JLabel(); this.$$$loadLabelText$$$(headerLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin") .getString("TfsLoginForm.Header")); contentPanel.add(headerLabel, new GridConstraints(0, 1, 1, 4, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label1 = new JLabel(); this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin") .getString("TfsLoginForm.ServerUrl")); contentPanel.add(label1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); serverUrl = new JTextField(); contentPanel.add(serverUrl, new GridConstraints(2, 2, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); exampleLabel = new JLabel(); this.$$$loadLabelText$$$(exampleLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin") .getString("TfsLoginForm.ExampleUrl")); contentPanel.add(exampleLabel, new GridConstraints(3, 2, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); signInLink = new Hyperlink(); this.$$$loadLabelText$$$(signInLink, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin") .getString("TfsLoginForm.Connect")); contentPanel.add(signInLink, new GridConstraints(4, 2, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); contentPanel.add(vsIcon, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); loginProgressLabel = new JLabel(); loginProgressLabel.setText("Sample Text for Busy Spinner Message"); contentPanel.add(loginProgressLabel, new GridConstraints(5, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); busySpinner = new BusySpinnerPanel(); contentPanel.add(busySpinner, new GridConstraints(5, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final Spacer spacer2 = new Spacer(); contentPanel.add(spacer2, new GridConstraints(5, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); descriptionLabel = new WrappingLabel(); descriptionLabel.setText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin") .getString("TfsLoginForm.Description")); contentPanel.add(descriptionLabel, new GridConstraints(1, 1, 1, 4, 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, 0, false)); }
From source file:lisong_mechlab.view.graphs.SustainedDpsGraph.java
/** * Creates and displays the {@link SustainedDpsGraph}. * /* ww w .j a va 2 s . co m*/ * @param aLoadout * Which load out the diagram is for. * @param aXbar * A {@link MessageXBar} to listen for changes to the loadout on. * @param aMaxSustainedDpsMetric * A {@link MaxSustainedDPS} instance to use in calculation. */ public SustainedDpsGraph(LoadoutBase<?> aLoadout, MessageXBar aXbar, MaxSustainedDPS aMaxSustainedDpsMetric) { super("Max Sustained DPS over range for " + aLoadout); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); aXbar.attach(this); loadout = aLoadout; maxSustainedDPS = aMaxSustainedDpsMetric; chartPanel = new ChartPanel(makechart()); setContentPane(chartPanel); chartPanel.setLayout(new OverlayLayout(chartPanel)); JButton button = new JButton( new OpenHelp("What is this?", "Max-sustained-dps-graph", KeyStroke.getKeyStroke('w'))); button.setMargin(new Insets(5, 5, 5, 5)); button.setFocusable(false); button.setAlignmentX(Component.RIGHT_ALIGNMENT); button.setAlignmentY(Component.TOP_ALIGNMENT); chartPanel.add(button); setIconImage(ProgramInit.programIcon); setSize(800, 600); setVisible(true); }
From source file:com.sec.ose.osi.ui.frm.main.manage.dialog.JDlgProjectCreate.java
/** * This method initializes this/*from w ww . j a v a2s . co m*/ * * @return void */ private void initialize() { GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.gridx = 0; gridBagConstraints5.weightx = 0.1; gridBagConstraints5.weighty = 0.0; gridBagConstraints5.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints5.insets = new Insets(0, 10, 0, 0); gridBagConstraints5.gridy = 1; GridBagConstraints gridBagConstraints41 = new GridBagConstraints(); gridBagConstraints41.gridx = 0; gridBagConstraints41.weightx = 0.1; gridBagConstraints41.anchor = GridBagConstraints.CENTER; gridBagConstraints41.insets = new Insets(0, 10, 20, 0); gridBagConstraints41.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints41.gridy = 0; GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); gridBagConstraints3.gridx = 1; gridBagConstraints3.gridheight = 2; gridBagConstraints3.anchor = GridBagConstraints.NORTH; gridBagConstraints3.insets = new Insets(10, 0, 0, 0); gridBagConstraints3.gridy = 0; this.setSize(600, 250); this.setLayout(new GridBagLayout()); this.add(getJPanelButton(), gridBagConstraints3); this.add(getJPanelPjtName(), gridBagConstraints41); this.add(getJPanelSourceLocation(), gridBagConstraints5); getJTextFieldSourceLocation().setText(strPath); getJTextFieldSourceLocation().setToolTipText(strPath); }
From source file:com.limegroup.gnutella.gui.CurrentAudioStatusComponent.java
private void initComponents() { Dimension dimension = new Dimension(220, 22); setPreferredSize(dimension);//from w w w. ja v a 2 s .co m setMinimumSize(dimension); speakerIcon = GUIMediator.getThemeImage("speaker"); text = new JLabel(); Font f = new Font("DIALOG", Font.BOLD, 10); text.setFont(f); text.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { if (MediaPlayer.instance().getCurrentSong().getFile() != null || MediaPlayer.instance().getCurrentSong().getPlaylistItem() != null || MediaPlayer.instance().getCurrentSong() instanceof InternetRadioAudioSource || MediaPlayer.instance().getCurrentSong() instanceof DeviceAudioSource) { showCurrentSong(); } else if (MediaPlayer.instance().getCurrentSong() instanceof StreamAudioSource) { StreamAudioSource audioSource = (StreamAudioSource) MediaPlayer.instance().getCurrentSong(); if (audioSource.getDetailsUrl() != null) { GUIMediator.openURL(audioSource.getDetailsUrl()); } } else if (MediaPlayer.instance().getCurrentSong().getURL() != null) { GUIMediator.instance().setWindow(GUIMediator.Tabs.LIBRARY); } } }); shareButton = new MediaButton(I18n.tr("Send this file to a friend"), "share", "share"); shareButton.addActionListener(new SendToFriendActionListener()); shareButton.setVisible(false); //Share Button setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0; c.gridwidth = GridBagConstraints.RELATIVE; c.insets = new Insets(0, 0, 0, 3); add(shareButton, c);//, BorderLayout.LINE_END); //Go to Current Audio Control c.gridx = 0; c.gridx = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.anchor = GridBagConstraints.EAST; c.insets = new Insets(0, 0, 0, 0); add(text, c);//, BorderLayout.LINE_END); }