List of usage examples for javax.swing SwingConstants RIGHT
int RIGHT
To view the source code for javax.swing SwingConstants RIGHT.
Click Source Link
From source file:com.aw.core.format.FillerFormat.java
public static String fillNumWZero(String source, int length) { return fill(source, '0', length, SwingConstants.RIGHT); }
From source file:com.github.cmisbox.ui.BaseFrame.java
public BaseFrame() { super(AWTUtilitiesWrapper.isTranslucencyCapable(BaseFrame.gc) ? BaseFrame.gc : null); this.log = LogFactory.getLog(this.getClass()); this.gradient = false; this.setUndecorated(true); this.mainPanel = new JPanel(new GridBagLayout()) { private static final long serialVersionUID = 1035974033526970010L; protected void paintComponent(Graphics g) { if ((g instanceof Graphics2D) && BaseFrame.this.gradient) { final int R = 0; final int G = 0; final int B = 0; Paint p = new GradientPaint(0.0f, 0.0f, new Color(R, G, B, 192), this.getWidth(), this.getHeight(), new Color(R, G, B, 255), true); Graphics2D g2d = (Graphics2D) g; g2d.setPaint(p);/*w w w. j a v a 2 s . co m*/ g2d.fillRect(0, 0, this.getWidth(), this.getHeight()); } else { super.paintComponent(g); } } }; this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); GridBagConstraints gbc = new GridBagConstraints(); this.mainPanel.setDoubleBuffered(false); this.mainPanel.setOpaque(false); this.mainPanel.setBorder(BorderFactory.createLineBorder(Color.white)); JLabel title = new JLabel(this.getWindowTitle(), SwingConstants.CENTER); title.setForeground(Color.white); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridx = 1; gbc.gridy = 0; gbc.weightx = 100; this.mainPanel.add(title, gbc); Image closeImg = this.getImage("images/application-exit.png", 32, 32); JLabel close = new JLabel(new ImageIcon(closeImg), SwingConstants.RIGHT); gbc.fill = GridBagConstraints.NONE; gbc.gridx = 2; gbc.weightx = 0; this.mainPanel.add(close, gbc); close.addMouseListener(this.closeAdapter); this.getContentPane().add(this.mainPanel, BorderLayout.CENTER); this.initComponents(); this.pack(); this.mainPanel.setOpaque(!this.gradient); if (!this.gradient) { this.mainPanel.setBackground(new Color(0, 0, 0, 208)); } this.setLocationRelativeTo(null); AWTUtilitiesWrapper.setWindowOpaque(this, false); this.setVisible(true); this.setAlwaysOnTop(true); }
From source file:edu.ku.brc.af.ui.forms.PanelViewable.java
public Component createSeparator(final String title) { int titleAlignment = builder.isLeftToRight() ? SwingConstants.LEFT : SwingConstants.RIGHT; JComponent titledSeparator = builder.getComponentFactory().createSeparator(title, titleAlignment); setControlSize(titledSeparator);/* w w w . j a v a 2 s . c o m*/ return titledSeparator; }
From source file:net.sourceforge.processdash.ev.ui.ScheduleBalancingDialog.java
public ScheduleBalancingDialog(TaskScheduleDialog parent, EVTaskListRollup taskList) { this.parent = parent; this.rollupTaskList = taskList; super.button.setHorizontalAlignment(SwingConstants.RIGHT); setClickCountToStart(2);//from w w w. ja v a 2 s. co m }
From source file:edu.ku.brc.specify.toycode.UpdatesApp.java
protected void createUI() { baseBBP = new BrowseBtnPanel(baseTF, false, true); baseUpBBP = new BrowseBtnPanel(baseUpTF, false, true); macFullBBP = new BrowseBtnPanel(macFullTF, false, true); macUpBBP = new BrowseBtnPanel(macUpTF, false, true); outBBP = new BrowseBtnPanel(outTF, false, true); verSub1 = new JSpinner(); verSub2 = new JSpinner(); PanelBuilder pb = new PanelBuilder( new FormLayout("p,2px,p,f:p:g,p", createDuplicateJGoodiesDef("p:g", "4px", 7))); CellConstraints cc = new CellConstraints(); int y = 1;/*w ww. j a v a 2 s . c om*/ pb.add(createLabel("Linux/Win Full:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(baseBBP, cc.xyw(3, y, 3)); y += 2; pb.add(createLabel("Linux/Win Update:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(baseUpBBP, cc.xyw(3, y, 3)); y += 2; pb.add(createLabel("Mac Full:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(macFullBBP, cc.xyw(3, y, 3)); y += 2; pb.add(createLabel("Mac Update:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(macUpBBP, cc.xyw(3, y, 3)); y += 2; pb.add(createLabel("Output:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(outBBP, cc.xyw(3, y, 3)); y += 2; updateBaseTF.setText("6.0.0"); pb.add(createLabel("Update Base Version:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(updateBaseTF, cc.xy(3, y)); y += 2; versionTF.setText("6"); verSub1.setValue(99); verSub2.setValue(99); PanelBuilder vpb = new PanelBuilder(new FormLayout("p,p,p:g,p,p:g,f:p:g", "p")); vpb.add(versionTF, cc.xy(1, 1)); vpb.add(createLabel("."), cc.xy(2, 1)); vpb.add(verSub1, cc.xy(3, 1)); vpb.add(createLabel("."), cc.xy(4, 1)); vpb.add(verSub2, cc.xy(5, 1)); pb.add(createLabel("New Version:", SwingConstants.RIGHT), cc.xy(1, y)); pb.add(vpb.getPanel(), cc.xyw(3, y, 1)); y += 2; PanelBuilder pb2 = new PanelBuilder(new FormLayout("p,2px,p,f:p:g,p", "p")); statusTF.setBackground(getBackground()); pb2.add(statusTF, cc.xyw(1, 1, 4)); pb2.add(mergeBtn, cc.xy(5, 1)); pb.getPanel().setBorder(BorderFactory.createEmptyBorder(14, 14, 1, 14)); setLayout(new BorderLayout()); add(pb.getPanel(), BorderLayout.CENTER); add(pb2.getPanel(), BorderLayout.SOUTH); try { XStream xstream = new XStream(); props = (Properties) xstream.fromXML(FileUtils.readFileToString(new File("props.init"))); } catch (Exception ex) { props = new Properties(); } baseTF.setText(props.getProperty("baseTF", "MacMedia/updates.xml.winlinfull.6.1.17")); baseUpTF.setText(props.getProperty("baseUpTF", "MacMedia/updates.xml.winlinupdate.6.1.17")); macFullTF.setText(props.getProperty("macFullTF", "MacMedia/updates_mac.xml")); macUpTF.setText(props.getProperty("macUpTF", "MacMedia/updates_mac_update.xml")); outTF.setText(props.getProperty("outTF", "MacMedia/updates.xml")); updateBaseTF.setText(props.getProperty("updateBaseTF", "6.0.0")); versionTF.setText(props.getProperty("versionTF", "6")); verSub1.setValue(Integer.parseInt(props.getProperty("subVer1", "1"))); verSub2.setValue(Integer.parseInt(props.getProperty("subVer2", "11"))); mergeBtn.addActionListener(new ActionListener() { /* (non-Javadoc) * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ @Override public void actionPerformed(ActionEvent e) { merge(baseTF.getText(), baseUpTF.getText(), macFullTF.getText(), macUpTF.getText(), outTF.getText(), updateBaseTF.getText(), versionTF.getText(), Integer.toString((Integer) verSub1.getValue()), Integer.toString((Integer) verSub2.getValue())); doSave(outTF.getText()); } }); }
From source file:brainflow.app.presentation.controls.FileObjectGroupSelector.java
public static void main(String[] args) { try {/*w ww . java2 s .co m*/ com.jidesoft.utils.Lm.verifyLicense("UIN", "BrainFlow", "S5XiLlHH0VReaWDo84sDmzPxpMJvjP3"); //com.jidesoft.plaf.LookAndFeelFactory.installDefaultLookAndFeel(); //LookAndFeelFactory.installJideExtension(LookAndFeelFactory.OFFICE2007_STYLE); UIManager.setLookAndFeel(new NimbusLookAndFeel()); JFrame jf = new JFrame(); FileObjectGroupSelector selector = new FileObjectGroupSelector( VFS.getManager().resolveFile("c:/javacode")); ButtonPanel buttonPanel = new ButtonPanel(SwingConstants.RIGHT); buttonPanel.setSizeConstraint(ButtonPanel.NO_LESS_THAN); JButton okButton = new JButton("OK"); JButton resetButton = new JButton("Cancel"); buttonPanel.addButton(okButton, ButtonPanel.AFFIRMATIVE_BUTTON); buttonPanel.addButton(resetButton, ButtonPanel.CANCEL_BUTTON); buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 8, 8)); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(selector, BorderLayout.CENTER); panel.add(buttonPanel, BorderLayout.SOUTH); panel.setMinimumSize(new Dimension(800, 100)); jf.add(panel, BorderLayout.CENTER); jf.pack(); jf.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.aw.core.format.FillerFormat.java
public static String alignRight(String source, int length) { return fill(source, ' ', length, SwingConstants.RIGHT); }
From source file:davmail.ui.SettingsFrame.java
protected void addSettingComponent(JPanel panel, String label, JComponent component, String toolTipText) { JLabel fieldLabel = new JLabel(label); fieldLabel.setHorizontalAlignment(SwingConstants.RIGHT); fieldLabel.setVerticalAlignment(SwingConstants.CENTER); panel.add(fieldLabel);/* ww w . j a v a 2s . co m*/ component.setMaximumSize(component.getPreferredSize()); JPanel innerPanel = new JPanel(); innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.X_AXIS)); innerPanel.add(component); panel.add(innerPanel); if (toolTipText != null) { fieldLabel.setToolTipText(toolTipText); component.setToolTipText(toolTipText); } }
From source file:com.moneydance.modules.features.mdvenmoimporter.VenmoImporterWindow.java
public VenmoImporterWindow(Main extension) { super("VenmoImporter Console"); this.extension = extension; loadSettings();/*from w w w .j a va 2 s . c om*/ 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:eu.ggnet.dwoss.report.CreateViewCask.java
/** This method is called from within the constructor to * initialize the form.//w ww. ja va2 s .c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); contractorComboBox = new javax.swing.JComboBox(); startDateChooser = new com.toedter.calendar.JDateChooser(); endDateChooser = new com.toedter.calendar.JDateChooser(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); nameTextField = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); unreportedCheckBox = new javax.swing.JCheckBox(); jLabel5 = new javax.swing.JLabel(); viewModeComboBox = new javax.swing.JComboBox(); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Lieferant:"); contractorComboBox.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); contractorComboBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { contractorComboBoxActionPerformed(evt); } }); startDateChooser.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { startDateChooserMouseClicked(evt); } }); endDateChooser.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { endDateChooserPropertyChange(evt); } }); jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel2.setText("Ende:"); jLabel3.setText("Name:"); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jLabel4.setText("Begin:"); unreportedCheckBox.setText("Noch nicht gemeldete Elemente hinzufgen"); jLabel5.setText("ViewMode:"); viewModeComboBox.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(nameTextField)) .addGroup(layout.createSequentialGroup().addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)) .addGap(11, 11, 11) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(startDateChooser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(endDateChooser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGap(6, 6, 6)) .addGroup(layout.createSequentialGroup().addGap(0, 48, Short.MAX_VALUE) .addComponent(unreportedCheckBox).addContainerGap()) .addGroup(layout.createSequentialGroup() .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(contractorComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(viewModeComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(contractorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5).addComponent(viewModeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(startDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(endDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(unreportedCheckBox) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3).addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); }