public void addLabelAndSelectableLastField(String s, String value, Container parent) { addLabel(s, parent); JTextField field = new JTextField(value); field.setBorder(null); field.setOpaque(false); field.setEditable(false); addLastField(field, parent); } }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JTextField l = ((TreeFromFile) value).getLabel(); l.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); l.setOpaque(true); if(cellHasFocus || isSelected) { l.setBackground(highlightColor); } else { l.setBackground(Color.WHITE); } return l; }
/** * Adds the given tree to the display without removing already * displayed trees * @param match tree to be added */ private void addMatch(TreeFromFile match, List<Tree> matchedParts) { JPanel treeDisplay = new JPanel(new BorderLayout()); JTextField filename = new JTextField("From file: " + match.getFilename()); filename.setEditable(false); MouseInputAdapter listener = new FilenameMouseInputAdapter(filename); filename.addMouseListener(listener); filename.addMouseMotionListener(listener); treeDisplay.add(filename, BorderLayout.NORTH); if(TregexGUI.getInstance().isTdiffEnabled()) { tjp = getTreeJPanel(match.getDiffDecoratedTree(), matchedParts); tjp.setDiffConstituents(match.getDiffConstituents()); } else { tjp = getTreeJPanel(match.getTree(), matchedParts); } matchedPartCoordinates = tjp.getMatchedPartCoordinates(); matchedPartCoordinateIdx = -1; treeDisplay.add(tjp, BorderLayout.CENTER); filename.setOpaque(true); filename.setBackground(tjp.getBackground()); filename.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); scroller.setViewportView(treeDisplay); this.revalidate(); this.repaint(); }
this.textField.setOpaque(false); this.textField.setSelectedTextColor(Color.WHITE); this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT);
txtName.setFocusable(false); txtName.setMaximumSize(new java.awt.Dimension(50, 22)); txtName.setOpaque(false); txtName.setRequestFocusEnabled(false); txtName.addActionListener(evt -> txtNameActionPerformed(evt)); txtType.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtType.setFocusable(false); txtType.setOpaque(false); txtType.setRequestFocusEnabled(false); txtStartTime.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtStartTime.setFocusable(false); txtStartTime.setOpaque(false); txtStartTime.setRequestFocusEnabled(false); txtEndTime.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtEndTime.setFocusable(false); txtEndTime.setOpaque(false); txtEndTime.setRequestFocusEnabled(false); txtTournamentState.setBorder(javax.swing.BorderFactory.createEtchedBorder()); txtTournamentState.setFocusable(false); txtTournamentState.setOpaque(false); txtTournamentState.setRequestFocusEnabled(false);
/** * @see javax.swing.JComponent#setOpaque(boolean) */ public void setOpaque(boolean opaque) { super.setOpaque(opaque); if ( m_queryF != null ) { m_queryF.setOpaque(opaque); } if ( m_resultL != null ) m_resultL.setOpaque(opaque); if ( m_searchL != null ) m_searchL.setOpaque(opaque); }
/** * Unsets the borders of the field */ public void fieldNoBorders() { field.setOpaque(true); field.setBorder(null); }
private JTextField createTextField(String text) { JTextField field = new JTextField(text); field.setEditable(false); field.setBorder(null); field.setOpaque(false); return field; }
/** * Creates a new editor. */ public SubstanceComboBoxEditor() { super(); this.editor = new JTextField("", 9); this.editor.setBorder(null); this.editor.setOpaque(false); }
/** * Creates a new editor. */ public SubstanceComboBoxEditor() { super(); this.editor = new JTextField("", 9); this.editor.setBorder(null); this.editor.setOpaque(false); }
JFrame messenger = new JFrame("messenger"); JTextField tf = new JTextField(); tf.setOpaque(true); tf.setColumn(30); tf.setText("Some text"); tf.setBackground(new Color(248, 213, 131)); tf.setPreferredSize(new Dimension(200, 180)); messenger.getContentPane().add(tf, BorderLayout.CENTER); messenger.setVisible(true); messenger.pack(); messenger.setSize(new Dimension(250,175));
JTextField textField = new JTextField(10); textField.setOpaque( false ); JLabel label = new JLabel( new ImageIcon(...) ); label.setLayout( new BorderLayout() ); label.add( textField );
JTextField textField = new JTextField(10); textField.setOpaque( false ); JLabel label = new JLabel( new ImageIcon(...) ); label.setLayout( new BorderLayout() ); label.add( textField );
JTextField field = new JTextField(); field.setOpaque(false); JLabel label = new JLabel(); label.setIcon(...); label.setLayout(new BorderLayout()); label.add(field);
private void createCellTextComponent(FocusListener focusListener) { this.cellTextComponent = new JTextField(); this.cellTextComponent.setOpaque(true); this.cellTextComponent.setVisible(false); this.cellTextComponent.setBorder(new EmptyBorder(0, 0, 0, 0)); this.cellTextComponent.addFocusListener(focusListener); }
JTextField name = new JTextField(20); name.setOpaque(false); JTextField pass = new JTextField(20); pass.setOpaque(false); pass.setForeground(Color.WHITE); // being lazy: use SwingX JXPanel panel = new JXPanel(); BufferedImage back = XTestUtils.loadDefaultImage("moon.jpg"); panel.setBackgroundPainter(new ImagePainter(back)); panel.add(name); panel.add(pass);
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JTextField l = ((TreeFromFile) value).getLabel(); l.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); l.setOpaque(true); if(cellHasFocus || isSelected) { l.setBackground(highlightColor); } else { l.setBackground(Color.WHITE); } return l; }
/** * @return A new text field with default theme */ public static JTextField newTextField(int columns) { JTextField textField = new JTextField(columns); // Set the theme textField.setBorder(new TextBubbleBorder(Themes.currentTheme.dataEntryBorder())); textField.setBackground(Themes.currentTheme.dataEntryBackground()); textField.setOpaque(false); return textField; }
public static void configuraWebLaf(JTextField field, int margin, int leftMargin) { if (!WeblafUtils.weblafEstaInstalado()) { return; } ((WebTextFieldUI) field.getUI()).setDrawBorder(false); ((WebTextFieldUI) field.getUI()).setDrawBackground(true); field.setBorder(new EmptyBorder(margin, leftMargin, margin, margin)); field.setOpaque(true); field.setBackground(ColorController.COR_CONSOLE); field.setForeground(ColorController.COR_LETRA); }
public static void configuraWebLaf(JTextField field) { if (!WeblafUtils.weblafEstaInstalado()) { return; } ((WebTextFieldUI) field.getUI()).setDrawBorder(false); ((WebTextFieldUI) field.getUI()).setDrawBackground(true); // field.setBorder(new EmptyBorder(15,15,15,15)); field.setOpaque(true); field.setBackground(ColorController.COR_DESTAQUE); field.setForeground(ColorController.COR_LETRA); } public static void configuraWebLaf(JTextField field, int margin, int leftMargin) {