private JPanel getSavePreferencesImmediatelyPanel() { JPanel ret = new JPanel(new BorderLayout(3,3)); ret.add(new MultilineLabel(s_stringMgr.getString("GeneralPreferencesPanel.savePreferencesImmediatelyWarning")), BorderLayout.CENTER); ret.add(_savePreferencesImmediately, BorderLayout.SOUTH); ret.setBorder(BorderFactory.createEtchedBorder()); return ret; }
/** * Adjusts UI to make sure it looks like a label instead of a text area. */ protected void adjustUI() { setLineWrap(true); setWrapStyleWord(true); setEditable(false); setRequestFocusEnabled(false); setFocusable(false); JideSwingUtilities.setComponentTransparent(this); setCaret(new DefaultCaret() { private static final long serialVersionUID = 1242467463492127346L; @Override protected void adjustVisibility(Rectangle nloc) { } }); LookAndFeel.installBorder(this, "Label.border"); Color fg = getForeground(); if (fg == null || fg instanceof UIResource) { setForeground(UIManager.getColor("Label.foreground")); } Font f = getFont(); if (f == null || f instanceof UIResource) { setFont(UIManager.getFont("Label.font")); } setBackground(null); }
private void prepareForErrorDisplay() { _label.setBackground(Color.white); _label.setForeground(Color.red); _label.setFont(_label.getFont().deriveFont(Font.BOLD)); _btnClose.setVisible(true); _isDisplayingError = true; } }
@Override public void setEnabled(boolean b) { super.setEnabled(b); _button.setEnabled(b); _label.setEnabled(b); }
_lblReadOnWarning.setEnabled(true); _lblReadOnWarning.setEnabled(false);
private JPanel getSavePreferencesImmediatelyPanel() { JPanel ret = new JPanel(new BorderLayout(3,3)); ret.add(new MultilineLabel(s_stringMgr.getString("GeneralPreferencesPanel.savePreferencesImmediatelyWarning")), BorderLayout.CENTER); ret.add(_savePreferencesImmediately, BorderLayout.SOUTH); ret.setBorder(BorderFactory.createEtchedBorder()); return ret; }
_lblReadOnWarning.setEnabled(true); _lblReadOnWarning.setEnabled(false);
private JPanel createLabelPanel(String hqlQuery) { JPanel ret = new JPanel(new GridBagLayout()); GridBagConstraints gbc; gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 10, 5, 10), 0, 0); ret.add(new JLabel(s_stringMgr.getString("WaitPanel.hqlLabel")), gbc); gbc = new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 10, 5, 10), 0, 0); _label = new MultilineLabel(hqlQuery); ret.add(_label, gbc); return ret; }
/** * constructor. * * @param type the type of toggle button to create * @param labelTxt the label */ public MultilineToggleButton(int type, String labelTxt) { if (type == CHECKBOX_TYPE) { _button = new JCheckBox(); } else if (type == RADIOBUTTON_TYPE) { _button = new JRadioButton(); } else { _button = new JToggleButton(); } _label = new MultilineLabel(labelTxt); build(); }
private void createUI() { getContentPane().setLayout(new GridBagLayout()); GridBagConstraints gbc; int gridy = 0; gbc = new GridBagConstraints(0, gridy,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5), 0,0); getContentPane().add(new MultilineLabel(s_stringMgr.getString("EditPasteTableNameDlg.text")), gbc); gbc = new GridBagConstraints(0,++gridy,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5), 0,0); getContentPane().add(_txtTableName, gbc); if (null != _destTableName) { gbc = new GridBagConstraints(0,++gridy,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5,5,5,5), 0,0); JLabel lblDestNameLink = new JLabel(s_stringMgr.getString("EditPasteTableNameDlg.htmlSetNameTo", _destTableName)); lblDestNameLink.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); lblDestNameLink.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { _txtTableName.setText(_destTableName); } }); getContentPane().add(lblDestNameLink, gbc); } gbc = new GridBagConstraints(0,++gridy,1,1,1,1,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(10,5,5,5), 0,0); getContentPane().add(new JPanel(), gbc); gbc = new GridBagConstraints(0,++gridy,1,1,0,0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(10,5,5,5), 0,0); getContentPane().add(createButtonPanel(), gbc); }
content.add(new MultilineLabel(lblText), gbc); content.add(txtDir, gbc); content.add(new MultilineLabel(lblText), gbc);