List of usage examples for javax.swing JLabel setHorizontalAlignment
@BeanProperty(visualUpdate = true, enumerationValues = { "SwingConstants.LEFT", "SwingConstants.CENTER", "SwingConstants.RIGHT", "SwingConstants.LEADING", "SwingConstants.TRAILING" }, description = "The alignment of the label's content along the X axis.") public void setHorizontalAlignment(int alignment)
From source file:com.github.cric.app.ui.SettingPanel.java
private JLabel label(String defaultValue, String mnemonic) { JLabel label = new JLabel(defaultValue); label.setToolTipText(mnemonic);//from w ww .ja va 2s .com label.setHorizontalAlignment(JLabel.RIGHT); return label; }
From source file:net.sf.firemox.ui.wizard.About.java
/** * Creates a new instance of About <br> * // w w w . ja va 2s. c o m * @param parent */ public About(JFrame parent) { super(LanguageManager.getString("wiz_about.title"), LanguageManager.getString("wiz_about.description"), "mp64.gif", LanguageManager.getString("close"), 420, 620); JPanel thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setMaximumSize(new Dimension(32767, 26)); thanksPanel.setOpaque(false); JLabel jLabel5 = new JLabel(LanguageManager.getString("version") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(jLabel5); jLabel5 = new JLabel(IdConst.VERSION); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setOpaque(false); JPanel thanksPanelLeft = new JPanel(new FlowLayout(FlowLayout.LEADING)); thanksPanelLeft.setLayout(new BoxLayout(thanksPanelLeft, BoxLayout.Y_AXIS)); thanksPanelLeft.setMaximumSize(new Dimension(100, 2000)); thanksPanelLeft.setMinimumSize(new Dimension(100, 16)); jLabel5 = new JLabel(LanguageManager.getString("thanks") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanelLeft.add(jLabel5); thanksPanel.add(thanksPanelLeft); thanksPanelLeft = new JPanel(); thanksPanelLeft.setLayout(new BoxLayout(thanksPanelLeft, BoxLayout.Y_AXIS)); StringBuilder contributors = new StringBuilder(); addContributor(contributors, "Fabrice Daugan", "developper", "france"); addContributor(contributors, "Hoani Cross", "developper", "frenchpolynesia"); addContributor(contributors, "nico100", "graphist", "france"); addContributor(contributors, "seingalt_tm", "graphist", "france"); addContributor(contributors, "surtur2", "tester", null); addContributor(contributors, "Jan Blaha", "developper", "cz"); addContributor(contributors, "Tureba", "developper", "brazil"); addContributor(contributors, "hakvf", "tester", "france"); addContributor(contributors, "Stefano \"Kismet\" Lenzi", "developper", "italian"); jLabel5 = new JLabel(contributors.toString()); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.LEFT); thanksPanelLeft.add(jLabel5); jLabel5 = new JLink("http://obsidiurne.free.fr", "morgil has designed the splash screen"); jLabel5.setFont(MToolKit.defaultFont); thanksPanelLeft.add(jLabel5); thanksPanel.add(thanksPanelLeft); gameParamPanel.add(thanksPanel); thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setMaximumSize(new Dimension(32767, 26)); thanksPanel.setOpaque(false); JLabel blanklbl = new JLabel(); blanklbl.setHorizontalAlignment(SwingConstants.RIGHT); blanklbl.setMaximumSize(new Dimension(100, 16)); blanklbl.setMinimumSize(new Dimension(100, 16)); blanklbl.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(blanklbl); jLabel5 = new JLink( "http://sourceforge.net/tracker/?func=add&group_id=" + IdConst.PROJECT_ID + "&atid=601043", LanguageManager.getString("joindev")); jLabel5.setFont(MToolKit.defaultFont); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setOpaque(false); jLabel5 = new JLabel(LanguageManager.getString("projecthome") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(jLabel5); jLabel5 = new JLink(IdConst.MAIN_PAGE, IdConst.MAIN_PAGE); jLabel5.setFont(MToolKit.defaultFont); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); // forum francais thanksPanel = new JPanel(); thanksPanel.setLayout(new BoxLayout(thanksPanel, BoxLayout.X_AXIS)); thanksPanel.setOpaque(false); jLabel5 = new JLabel(LanguageManager.getString("othersites") + " : "); jLabel5.setFont(MToolKit.defaultFont); jLabel5.setHorizontalAlignment(SwingConstants.RIGHT); jLabel5.setMaximumSize(new Dimension(100, 16)); jLabel5.setMinimumSize(new Dimension(100, 16)); jLabel5.setPreferredSize(new Dimension(100, 16)); thanksPanel.add(jLabel5); jLabel5 = new JLink("http://www.Firemox.fr.st", UIHelper.getIcon("mpfrsml.gif"), SwingConstants.LEFT); jLabel5.setToolTipText(LanguageManager.getString("frenchforum.tooltip")); thanksPanel.add(jLabel5); jLabel5 = new JLabel(); jLabel5.setMaximumSize(new Dimension(1000, 16)); thanksPanel.add(jLabel5); gameParamPanel.add(thanksPanel); JTextArea disclaimer = new JTextArea(); disclaimer.setEditable(false); disclaimer.setLineWrap(true); disclaimer.setWrapStyleWord(true); disclaimer.setAutoscrolls(true); disclaimer.setTabSize(2); disclaimer.setFont(new Font("Arial", 0, 10)); // Then try and read it locally BufferedReader inGPL = null; try { inGPL = new BufferedReader(new InputStreamReader(MToolKit.getResourceAsStream(IdConst.FILE_LICENSE))); disclaimer.read(inGPL, ""); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(inGPL); } JScrollPane disclaimerSPanel = new JScrollPane(); disclaimerSPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); MToolKit.addOverlay(disclaimerSPanel); disclaimerSPanel.setViewportView(disclaimer); gameParamPanel.add(disclaimerSPanel); }
From source file:com.moneydance.modules.features.mdvenmoimporter.VenmoImporterWindow.java
public VenmoImporterWindow(Main extension) { super("VenmoImporter Console"); this.extension = extension; loadSettings();/* w w w . ja v a 2 s. com*/ setResizable(false); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setBounds(100, 100, 516, 176); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(10, 10, 10, 10)); setContentPane(contentPane); contentPane.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("8dlu"), FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, })); JLabel lblVenmoToken = new JLabel("Venmo Token"); lblVenmoToken.setHorizontalAlignment(SwingConstants.RIGHT); contentPane.add(lblVenmoToken, "2, 2"); venmoTokenField = new JTextField(venmoToken); venmoTokenField.setToolTipText(venmoTokenTooltip); contentPane.add(venmoTokenField, "4, 2, fill, default"); venmoTokenField.setColumns(50); JLabel lblAccount = new JLabel("Account"); contentPane.add(lblAccount, "2, 4, right, default"); targetAccountCombo = new JComboBox<>( new Vector<>(extension.getUnprotectedContext().getRootAccount().getSubAccounts())); contentPane.add(targetAccountCombo, "4, 4, fill, default"); if (targetAcctId != null) { targetAccountCombo.setSelectedItem( extension.getUnprotectedContext().getCurrentAccountBook().getAccountByUUID(targetAcctId)); } JLabel lblDescriptionFormat = new JLabel("Memo template"); contentPane.add(lblDescriptionFormat, "2, 6, right, default"); descriptionFormatField = new JTextField( descriptionFormat == null ? descriptionFormatDefault : descriptionFormat); descriptionFormatField.setToolTipText(descriptionFormatTooltip); contentPane.add(descriptionFormatField, "4, 6, fill, default"); descriptionFormatField.setColumns(10); panel = new JPanel(); panel.setBorder(null); contentPane.add(panel, "2, 8, 3, 1, fill, fill"); btnDelete = new JButton("Delete Settings"); panel.add(btnDelete); btnCancel = new JButton("Cancel"); panel.add(btnCancel); btnSave = new JButton("Save"); panel.add(btnSave); btnDownloadTransactions = new JButton("Download Transactions"); panel.add(btnDownloadTransactions); btnCancel.addActionListener(this); btnSave.addActionListener(this); btnDelete.addActionListener(this); btnDownloadTransactions.addActionListener(this); enableEvents(WindowEvent.WINDOW_CLOSING); }
From source file:dpcs.About.java
public About() { setIconImage(Toolkit.getDefaultToolkit().getImage(About.class.getResource("/graphics/Icon.png"))); setResizable(false);//from w ww .j a va2 s . com setType(Type.UTILITY); setTitle("About"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 540, 400); contentPane = new JPanel(); contentPane.setBackground(Color.WHITE); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); try { InputStreamReader reader2 = new InputStreamReader( getClass().getResourceAsStream("/others/app-version.txt")); String tmp = IOUtils.toString(reader2); AppVersion = Double.parseDouble(tmp); } catch (IOException e1) { e1.printStackTrace(); } JButton btnGitHub = new JButton("GitHub"); btnGitHub.setToolTipText("Access Droid PC Suite github repository"); btnGitHub.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { Desktop.getDesktop().browse(new URL("https://github.com/kvsjxd/Droid-PC-Suite/").toURI()); } catch (Exception e) { e.printStackTrace(); } } }); btnGitHub.setBounds(369, 295, 111, 25); contentPane.add(btnGitHub); JLabel lblMyFriend4 = new JLabel("Gulati-kun"); lblMyFriend4.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMyFriend4.setBounds(25, 266, 242, 24); contentPane.add(lblMyFriend4); JLabel lblMyFriend3 = new JLabel("Anil-kun"); lblMyFriend3.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMyFriend3.setBounds(25, 242, 242, 24); contentPane.add(lblMyFriend3); JLabel lblMyFriend2 = new JLabel("Suri-kun"); lblMyFriend2.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMyFriend2.setBounds(25, 217, 242, 24); contentPane.add(lblMyFriend2); JLabel lblApplicationVersion = new JLabel("Version: " + AppVersion); lblApplicationVersion.setFont(new Font("Dialog", Font.BOLD, 14)); lblApplicationVersion.setBounds(382, 16, 132, 18); contentPane.add(lblApplicationVersion); JLabel lblForMyOther = new JLabel("For my other Android stuff visit me on XDA - Developers (@kvsjxd)"); lblForMyOther.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { try { Desktop.getDesktop().browse(new URL( "http://forum.xda-developers.com/member.php?s=82fb1dacfee601c8f79084b30d57d5a2&u=5640594") .toURI()); } catch (Exception e) { e.printStackTrace(); } } @Override public void mouseEntered(MouseEvent e) { lblForMyOther.setForeground(Color.BLUE); } @Override public void mouseExited(MouseEvent e) { lblForMyOther.setForeground(Color.BLACK); } }); lblForMyOther.setFont(new Font("Dialog", Font.PLAIN, 15)); lblForMyOther.setBounds(25, 321, 502, 24); contentPane.add(lblForMyOther); JLabel lblMySensei2 = new JLabel("Karun Sensei"); lblMySensei2.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMySensei2.setBounds(25, 120, 242, 24); contentPane.add(lblMySensei2); JLabel lblMySensei1 = new JLabel("Prashotam Sensei"); lblMySensei1.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMySensei1.setBounds(25, 98, 242, 24); contentPane.add(lblMySensei1); JLabel lblDaretobe = new JLabel("D4r3T0B3"); lblDaretobe.setFont(new Font("Dialog", Font.PLAIN, 15)); lblDaretobe.setBounds(25, 194, 242, 24); contentPane.add(lblDaretobe); JLabel label_9 = new JLabel(""); label_9.setToolTipText("This variation of android robot is created using Androidify"); label_9.setIcon(new ImageIcon(About.class.getResource("/graphics/Droidrobot.png"))); label_9.setBounds(334, 50, 180, 270); contentPane.add(label_9); JLabel lblDeveloper = new JLabel("Developer"); lblDeveloper.setFont(new Font("Dialog", Font.BOLD, 16)); lblDeveloper.setBounds(25, 12, 233, 24); contentPane.add(lblDeveloper); JLabel lblMrAleksandarDespotovski_shi = new JLabel("Aleksandar Despotovski-shi"); lblMrAleksandarDespotovski_shi.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMrAleksandarDespotovski_shi.setBounds(25, 169, 242, 24); contentPane.add(lblMrAleksandarDespotovski_shi); JLabel lblMyname = new JLabel("Karanvir Singh"); lblMyname.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { try { Desktop.getDesktop().browse(new URL( "http://forum.xda-developers.com/member.php?s=82fb1dacfee601c8f79084b30d57d5a2&u=5640594") .toURI()); } catch (Exception e1) { e1.printStackTrace(); } } @Override public void mouseEntered(MouseEvent e) { lblMyname.setForeground(Color.BLUE); } @Override public void mouseExited(MouseEvent e) { lblMyname.setForeground(Color.RED); } }); lblMyname.setForeground(Color.RED); lblMyname.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 16)); lblMyname.setBounds(25, 36, 242, 24); contentPane.add(lblMyname); JLabel lblMyFriend1 = new JLabel("My friend - Chetan-kun"); lblMyFriend1.setFont(new Font("Dialog", Font.PLAIN, 15)); lblMyFriend1.setBounds(25, 145, 242, 24); contentPane.add(lblMyFriend1); JLabel label_6 = new JLabel("Special thanks to"); label_6.setForeground(UIManager.getColor("OptionPane.questionDialog.titlePane.shadow")); label_6.setFont(new Font("Dialog", Font.BOLD, 16)); label_6.setBounds(25, 71, 240, 25); contentPane.add(label_6); JLabel lblGoogle = new JLabel( "Android, android green colored robot are trademarks of Google, Inc. We are not affliated with Google, Inc. in any way."); lblGoogle.setHorizontalAlignment(SwingConstants.LEFT); lblGoogle.setFont(new Font("Dialog", Font.PLAIN, 8)); lblGoogle.setBounds(25, 341, 514, 24); contentPane.add(lblGoogle); }
From source file:com.intel.stl.ui.monitor.view.PSNodesDetailsPanel.java
/** * Description:/*from w ww .j a va 2s . c o m*/ * * @param name */ protected void initComponent() { setLayout(new BorderLayout(0, 0)); setOpaque(false); setBorder(BorderFactory.createTitledBorder((Border) null)); JPanel titlePanel = new JPanel(new BorderLayout(5, 1)); titlePanel.setOpaque(false); numberLabel = ComponentFactory.getH1Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.PLAIN); numberLabel.setHorizontalAlignment(JLabel.RIGHT); titlePanel.add(numberLabel, BorderLayout.CENTER); nameLabel = ComponentFactory.getH3Label("", Font.PLAIN); nameLabel.setHorizontalAlignment(JLabel.LEFT); nameLabel.setVerticalAlignment(JLabel.BOTTOM); titlePanel.add(nameLabel, BorderLayout.EAST); add(titlePanel, BorderLayout.NORTH); JPanel mainPanel = new JPanel(); mainPanel.setOpaque(false); mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2)); GridBagLayout gridBag = new GridBagLayout(); mainPanel.setLayout(gridBag); GridBagConstraints gc = new GridBagConstraints(); gc.weighty = 0; gc.insets = new Insets(8, 2, 2, 2); gc.weightx = 1; gc.gridwidth = 1; gc.gridheight = 2; // gc.gridheight = 3; // Should change to 3 if we add Route typeChartPanel = new ChartPanel(null); typeChartPanel.setPreferredSize(new Dimension(80, 60)); mainPanel.add(typeChartPanel, gc); gc.fill = GridBagConstraints.BOTH; gc.insets = new Insets(12, 2, 2, 2); gc.weightx = 0; gc.gridheight = 1; swNumberLabel = createNumberLabel(); mainPanel.add(swNumberLabel, gc); gc.gridwidth = GridBagConstraints.REMAINDER; swNameLabel = createNameLabel(STLConstants.K0048_SWITCHES.getValue()); mainPanel.add(swNameLabel, gc); gc.insets = new Insets(2, 2, 6, 2); gc.gridwidth = 1; fiNumberLabel = createNumberLabel(); mainPanel.add(fiNumberLabel, gc); gc.gridwidth = GridBagConstraints.REMAINDER; fiNameLabel = createNameLabel(STLConstants.K0052_HOSTS.getValue()); mainPanel.add(fiNameLabel, gc); // gc.gridwidth = 1; // rtNumberLabel = ComponentFactory.getH4Label( // STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.PLAIN); // rtNumberLabel.setHorizontalAlignment(JLabel.CENTER); // mainPanel.add(rtNumberLabel, gc); // // gc.gridwidth = GridBagConstraints.REMAINDER; // rtNameLabel = ComponentFactory.getH5Label( // STLConstants.K0050_ROUTERS.getValue(), Font.PLAIN); // rtNameLabel.setVerticalAlignment(JLabel.BOTTOM); // mainPanel.add(rtNameLabel, gc); add(mainPanel, BorderLayout.CENTER); JPanel bottomPanel = new JPanel(new GridBagLayout()); bottomPanel.setOpaque(false); bottomPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.INTEL_BORDER_GRAY)); gc = new GridBagConstraints(); gc.insets = new Insets(0, 5, 1, 5); gc.fill = GridBagConstraints.BOTH; gc.weightx = 1; gc.gridheight = 2; otherPortsLabel = ComponentFactory.getH1Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.PLAIN); otherPortsLabel.setForeground(UIConstants.INTEL_GRAY); otherPortsLabel.setHorizontalAlignment(JLabel.RIGHT); bottomPanel.add(otherPortsLabel, gc); gc.gridwidth = GridBagConstraints.REMAINDER; gc.gridheight = 1; gc.weightx = 0; gc.weighty = 1; JLabel label = ComponentFactory.getH4Label(STLConstants.K1026_PORT_RESOURCE.getValue(), Font.PLAIN); label.setHorizontalAlignment(JLabel.LEFT); label.setVerticalAlignment(JLabel.BOTTOM); bottomPanel.add(label, gc); gc.weighty = 0; label = ComponentFactory.getH4Label(STLConstants.K2077_NOT_IN_FABRIC.getValue(), Font.PLAIN); label.setHorizontalAlignment(JLabel.LEFT); label.setVerticalAlignment(JLabel.BOTTOM); bottomPanel.add(label, gc); add(bottomPanel, BorderLayout.SOUTH); }
From source file:edu.harvard.mcz.imagecapture.BulkMediaFrame.java
private void init() { thisFrame = this; setTitle("BulkMedia Preparation"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 902, 174);/*w w w . j ava 2s.c o m*/ JMenuBar menuBar = new JMenuBar(); setJMenuBar(menuBar); JMenu mnFile = new JMenu("File"); mnFile.setMnemonic(KeyEvent.VK_F); menuBar.add(mnFile); JMenuItem mntmPrepareDirectory = new JMenuItem("Prepare Directory"); mntmPrepareDirectory.setMnemonic(KeyEvent.VK_D); mntmPrepareDirectory.addActionListener(new PrepareDirectoryAction()); mnFile.add(mntmPrepareDirectory); JMenuItem mntmNewMenuItem = new JMenuItem("Exit"); mntmNewMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { done(); } }); JMenuItem mntmNewMenuItem_1 = new JMenuItem("Edit Properties"); mntmNewMenuItem_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PropertiesEditor p = new PropertiesEditor(); p.pack(); p.setVisible(true); } }); mnFile.add(mntmNewMenuItem_1); mntmNewMenuItem.setMnemonic(KeyEvent.VK_X); mntmNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK)); mnFile.add(mntmNewMenuItem); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(new BorderLayout(0, 0)); JPanel panel = new JPanel(); contentPane.add(panel, BorderLayout.CENTER); panel.setLayout(new GridLayout(3, 2, 0, 0)); JLabel lblBaseUri = new JLabel("Base URI (first part of path to images on the web)"); lblBaseUri.setHorizontalAlignment(SwingConstants.TRAILING); panel.add(lblBaseUri, "2, 2"); textField = new JTextField(); textField.setEditable(false); textField.setText(Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_IMAGEBASEURI)); panel.add(textField); textField.setColumns(10); JLabel lblNewLabel = new JLabel("Local Path To Base (local mount path that maps to base URI)"); lblNewLabel.setHorizontalAlignment(SwingConstants.TRAILING); panel.add(lblNewLabel); textField_1 = new JTextField(); textField_1.setEditable(false); textField_1.setText(Singleton.getSingletonInstance().getProperties().getProperties() .getProperty(ImageCaptureProperties.KEY_IMAGEBASE)); panel.add(textField_1); textField_1.setColumns(10); JLabel lblBeforeExitingWait = new JLabel( "Before exiting wait for both the Done and Thumbnails Built messages."); panel.add(lblBeforeExitingWait); JLabel lblThumbnailGenerationIs = new JLabel("Thumbnail generation is not reported on the progress bar."); panel.add(lblThumbnailGenerationIs); progressBar = new JProgressBar(); progressBar.setStringPainted(false); contentPane.add(progressBar, BorderLayout.NORTH); JPanel panel_1 = new JPanel(); contentPane.add(panel_1, BorderLayout.SOUTH); JButton btnPrepareDirectory = new JButton("Run"); btnPrepareDirectory.setToolTipText("Select a directory and prepare a bulk media file for images therein."); panel_1.add(btnPrepareDirectory); btnPrepareDirectory.addActionListener(new PrepareDirectoryAction()); btnPrepareDirectory.setPreferredSize(new Dimension(80, 25)); JButton btnExit = new JButton("Exit"); btnExit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { done(); } }); panel_1.add(btnExit); }
From source file:net.vanosten.dings.swing.SummaryView.java
private void initComponents() { chartP = new JPanel(); chartP.setLayout(new BorderLayout()); //to begin with we show an information JLabel infoL = new JLabel( "Choose the chart type belwo and press the \"Update View\" button to show statistics."); infoL.setEnabled(false); //only for display infoL.setHorizontalAlignment(SwingConstants.CENTER); chartP.add(infoL, BorderLayout.CENTER); Vector<String> items = new Vector<String>(); items.add("Entries by " + Toolbox.getInstance().getInfoPointer().getUnitLabel()); items.add("Entries by " + Toolbox.getInstance().getInfoPointer().getCategoryLabel()); items.add("Entries by Entry Type"); items.add("Entries by Score"); items.add("Entry Scores over Time"); //do not change sequence of elements, as showGraph() and checkChosenStattype rely on it chartTypeCB = new JComboBox(items); chartTypeCB.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { if (4 == chartTypeCB.getSelectedIndex()) { chosenCB.setEnabled(false); } else { chosenCB.setEnabled(true); }//from w w w. j a v a 2 s .c o m } }); chosenCB = new JCheckBox("Only Selected Entries", false); chosenCB.setMnemonic("O".charAt(0)); }
From source file:com.litt.core.security.license.gui.ValidatePanel.java
/** * Create the panel.//from w ww . ja v a 2 s. c o m */ public ValidatePanel() { GridBagLayout gbl_validatePanel = new GridBagLayout(); gbl_validatePanel.columnWidths = new int[] { 0, 0, 0 }; gbl_validatePanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_validatePanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_validatePanel.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, Double.MIN_VALUE }; this.setLayout(gbl_validatePanel); JLabel label_10 = new JLabel(""); GridBagConstraints gbc_label_10 = new GridBagConstraints(); gbc_label_10.insets = new Insets(0, 0, 5, 5); gbc_label_10.anchor = GridBagConstraints.EAST; gbc_label_10.gridx = 0; gbc_label_10.gridy = 0; this.add(label_10, gbc_label_10); field_pubKeyFilePath = new JTextField(); field_pubKeyFilePath.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { JFileChooser fileChooser = new JFileChooser(); //fileChooser.setVisible(true); LicenseFileFilter fileFilter = new LicenseFileFilter(new String[] { "key" }); fileChooser.setFileFilter(fileFilter); fileChooser.addChoosableFileFilter(fileFilter); fileChooser.showOpenDialog(e.getComponent()); File pubKeyFile = fileChooser.getSelectedFile(); field_pubKeyFilePath.setText(pubKeyFile.getAbsolutePath()); } }); GridBagConstraints gbc_field_pubKeyFilePath = new GridBagConstraints(); gbc_field_pubKeyFilePath.insets = new Insets(0, 0, 5, 0); gbc_field_pubKeyFilePath.fill = GridBagConstraints.HORIZONTAL; gbc_field_pubKeyFilePath.gridx = 1; gbc_field_pubKeyFilePath.gridy = 0; this.add(field_pubKeyFilePath, gbc_field_pubKeyFilePath); field_pubKeyFilePath.setColumns(10); JLabel label_19 = new JLabel("?"); GridBagConstraints gbc_label_19 = new GridBagConstraints(); gbc_label_19.anchor = GridBagConstraints.EAST; gbc_label_19.insets = new Insets(0, 0, 5, 5); gbc_label_19.gridx = 0; gbc_label_19.gridy = 1; this.add(label_19, gbc_label_19); field_licenseFilePath = new JTextField(); field_licenseFilePath.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { JFileChooser fileChooser = new JFileChooser(); //fileChooser.setVisible(true); LicenseFileFilter fileFilter = new LicenseFileFilter(new String[] { "xml" }); fileChooser.setFileFilter(fileFilter); fileChooser.addChoosableFileFilter(fileFilter); fileChooser.showOpenDialog(e.getComponent()); File licenseFile = fileChooser.getSelectedFile(); field_licenseFilePath.setText(licenseFile.getAbsolutePath()); } }); GridBagConstraints gbc_textField1 = new GridBagConstraints(); gbc_textField1.insets = new Insets(0, 0, 5, 0); gbc_textField1.fill = GridBagConstraints.HORIZONTAL; gbc_textField1.gridx = 1; gbc_textField1.gridy = 1; this.add(field_licenseFilePath, gbc_textField1); field_licenseFilePath.setColumns(10); JLabel lblid = new JLabel("?ID"); lblid.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_lblid = new GridBagConstraints(); gbc_lblid.insets = new Insets(0, 0, 5, 5); gbc_lblid.gridx = 0; gbc_lblid.gridy = 2; this.add(lblid, gbc_lblid); label_licenseId = new JLabel(""); label_licenseId.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_label_licenseId = new GridBagConstraints(); gbc_label_licenseId.insets = new Insets(0, 0, 5, 0); gbc_label_licenseId.gridx = 1; gbc_label_licenseId.gridy = 2; this.add(label_licenseId, gbc_label_licenseId); JLabel label_12 = new JLabel("?"); GridBagConstraints gbc_label_12 = new GridBagConstraints(); gbc_label_12.insets = new Insets(0, 0, 5, 5); gbc_label_12.gridx = 0; gbc_label_12.gridy = 3; this.add(label_12, gbc_label_12); label_licenseType = new JLabel(""); GridBagConstraints gbc_label_licenseType = new GridBagConstraints(); gbc_label_licenseType.insets = new Insets(0, 0, 5, 0); gbc_label_licenseType.gridx = 1; gbc_label_licenseType.gridy = 3; this.add(label_licenseType, gbc_label_licenseType); JLabel label_13 = new JLabel("???"); GridBagConstraints gbc_label_13 = new GridBagConstraints(); gbc_label_13.insets = new Insets(0, 0, 5, 5); gbc_label_13.gridx = 0; gbc_label_13.gridy = 4; this.add(label_13, gbc_label_13); label_productName = new JLabel(""); GridBagConstraints gbc_label_productName = new GridBagConstraints(); gbc_label_productName.insets = new Insets(0, 0, 5, 0); gbc_label_productName.gridx = 1; gbc_label_productName.gridy = 4; this.add(label_productName, gbc_label_productName); JLabel label_14 = new JLabel("???"); GridBagConstraints gbc_label_14 = new GridBagConstraints(); gbc_label_14.insets = new Insets(0, 0, 5, 5); gbc_label_14.gridx = 0; gbc_label_14.gridy = 5; this.add(label_14, gbc_label_14); label_companyName = new JLabel(""); GridBagConstraints gbc_label_companyName = new GridBagConstraints(); gbc_label_companyName.insets = new Insets(0, 0, 5, 0); gbc_label_companyName.gridx = 1; gbc_label_companyName.gridy = 5; this.add(label_companyName, gbc_label_companyName); JLabel label_15 = new JLabel("??"); GridBagConstraints gbc_label_15 = new GridBagConstraints(); gbc_label_15.insets = new Insets(0, 0, 5, 5); gbc_label_15.gridx = 0; gbc_label_15.gridy = 6; this.add(label_15, gbc_label_15); label_customerName = new JLabel(""); GridBagConstraints gbc_label_customerName = new GridBagConstraints(); gbc_label_customerName.insets = new Insets(0, 0, 5, 0); gbc_label_customerName.gridx = 1; gbc_label_customerName.gridy = 6; this.add(label_customerName, gbc_label_customerName); JLabel label_16 = new JLabel(""); GridBagConstraints gbc_label_16 = new GridBagConstraints(); gbc_label_16.insets = new Insets(0, 0, 5, 5); gbc_label_16.gridx = 0; gbc_label_16.gridy = 7; this.add(label_16, gbc_label_16); label_version = new JLabel(""); GridBagConstraints gbc_label_version = new GridBagConstraints(); gbc_label_version.insets = new Insets(0, 0, 5, 0); gbc_label_version.gridx = 1; gbc_label_version.gridy = 7; this.add(label_version, gbc_label_version); JLabel label_11 = new JLabel(""); GridBagConstraints gbc_label_11 = new GridBagConstraints(); gbc_label_11.insets = new Insets(0, 0, 5, 5); gbc_label_11.gridx = 0; gbc_label_11.gridy = 8; this.add(label_11, gbc_label_11); label_createDate = new JLabel(""); GridBagConstraints gbc_label_createDate = new GridBagConstraints(); gbc_label_createDate.insets = new Insets(0, 0, 5, 0); gbc_label_createDate.gridx = 1; gbc_label_createDate.gridy = 8; this.add(label_createDate, gbc_label_createDate); JLabel label_17 = new JLabel(""); GridBagConstraints gbc_label_17 = new GridBagConstraints(); gbc_label_17.insets = new Insets(0, 0, 5, 5); gbc_label_17.gridx = 0; gbc_label_17.gridy = 9; this.add(label_17, gbc_label_17); label_expiredDate = new JLabel(""); GridBagConstraints gbc_label_expiredDate = new GridBagConstraints(); gbc_label_expiredDate.insets = new Insets(0, 0, 5, 0); gbc_label_expiredDate.gridx = 1; gbc_label_expiredDate.gridy = 9; this.add(label_expiredDate, gbc_label_expiredDate); JButton button_2 = new JButton(""); button_2.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { String licenseFilePath = Utility.trimNull(field_licenseFilePath.getText()); String pubKeyFilePath = Utility.trimNull(field_pubKeyFilePath.getText()); if (Utility.isEmpty(licenseFilePath)) { JOptionPane.showMessageDialog(e.getComponent(), "?!"); return; } if (Utility.isEmpty(pubKeyFilePath)) { JOptionPane.showMessageDialog(e.getComponent(), "!"); return; } File licenseFile = new File(licenseFilePath); try { XMLConfiguration config = new XMLConfiguration(licenseFile); config.setAutoSave(true); label_licenseId.setText(config.getString(("licenseId"))); label_licenseType.setText(config.getString("licenseType")); label_productName.setText(config.getString("productName")); label_companyName.setText(config.getString("companyName")); label_customerName.setText(config.getString("customerName")); label_version.setText(config.getString("version")); label_createDate.setText(config.getString("createDate")); label_expiredDate.setText(config.getString("expiredDate")); } catch (Exception e1) { // TODO Auto-generated catch block JOptionPane.showMessageDialog(e.getComponent(), e1.getMessage()); } try { LicenseManager.validateLicense(licenseFile.getAbsolutePath(), pubKeyFilePath); JOptionPane.showMessageDialog(e.getComponent(), "?"); } catch (LicenseException e1) { // TODO Auto-generated catch block JOptionPane.showMessageDialog(e.getComponent(), e1.getMessage()); } } }); GridBagConstraints gbc_button_2 = new GridBagConstraints(); gbc_button_2.gridx = 1; gbc_button_2.gridy = 10; this.add(button_2, gbc_button_2); }
From source file:cz.cvut.kbe.crypthelper.ui.MainPanel.java
public void setTableModel(CharacterTableModel tableModel) { this.tableModel = tableModel; charTable.setModel(tableModel);/*from w w w.jav a 2 s . co m*/ DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); label.setHorizontalAlignment(SwingConstants.CENTER); return label; } }; for (int i = 0; i < charTable.getColumnCount(); i++) { charTable.getColumnModel().getColumn(i).setCellRenderer(dtcr); } }
From source file:com.atlassian.theplugin.idea.config.serverconfig.GenericServerConfigForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/*from w w w.jav a 2 s. c o m*/ */ private void $$$setupUI$$$() { rootComponent = new JPanel(); rootComponent.setLayout(new GridBagLayout()); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(7, 3, new Insets(0, 0, 0, 0), -1, -1)); GridBagConstraints gbc; gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.BOTH; rootComponent.add(panel1, gbc); serverName = new JTextField(); serverName.setText(""); panel1.add(serverName, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JLabel label1 = new JLabel(); label1.setHorizontalAlignment(4); label1.setHorizontalTextPosition(4); label1.setText("Server Name:"); label1.setDisplayedMnemonic('S'); label1.setDisplayedMnemonicIndex(0); panel1.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, new Dimension(80, -1), new Dimension(92, 16), null, 0, false)); serverUrl = new JTextField(); panel1.add(serverUrl, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); username = new JTextField(); panel1.add(username, new GridConstraints(3, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); password = new JPasswordField(); panel1.add(password, new GridConstraints(4, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JLabel label2 = new JLabel(); label2.setHorizontalAlignment(4); label2.setText("Server URL:"); label2.setDisplayedMnemonic('U'); label2.setDisplayedMnemonicIndex(7); panel1.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, new Dimension(80, -1), new Dimension(92, 16), null, 0, false)); final JLabel label3 = new JLabel(); label3.setHorizontalAlignment(4); label3.setText("Username:"); label3.setDisplayedMnemonic('N'); label3.setDisplayedMnemonicIndex(4); panel1.add(label3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(92, 16), null, 0, false)); final JLabel label4 = new JLabel(); label4.setHorizontalAlignment(4); label4.setText("Password:"); label4.setDisplayedMnemonic('P'); label4.setDisplayedMnemonicIndex(0); panel1.add(label4, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(92, 16), null, 0, false)); testConnection = new JButton(); testConnection.setText("Test Connection"); testConnection.setMnemonic('T'); testConnection.setDisplayedMnemonicIndex(0); panel1.add(testConnection, new GridConstraints(5, 2, 1, 1, GridConstraints.ANCHOR_NORTHEAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); // chkPasswordRemember = new JCheckBox(); // chkPasswordRemember.setSelected(true); // chkPasswordRemember.setText("Remember Password"); // chkPasswordRemember.setMnemonic('R'); // chkPasswordRemember.setDisplayedMnemonicIndex(0); // panel1.add(chkPasswordRemember, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, // GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, // null, null, null, 0, false)); cbEnabled = new JCheckBox(); cbEnabled.setEnabled(false); cbEnabled.setHorizontalTextPosition(11); cbEnabled.setText("Server Enabled"); cbEnabled.setMnemonic('E'); cbEnabled.setDisplayedMnemonicIndex(7); panel1.add(cbEnabled, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(115, 25), null, 0, false)); useDefault = new JCheckBox(); useDefault.setText("Use Default Credentials"); panel1.add(useDefault, new GridConstraints(6, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JPanel spacer1 = new JPanel(); gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 1; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.VERTICAL; rootComponent.add(spacer1, gbc); label1.setLabelFor(serverName); label2.setLabelFor(serverUrl); label3.setLabelFor(username); label4.setLabelFor(password); }