Example usage for javax.swing.border EtchedBorder EtchedBorder

List of usage examples for javax.swing.border EtchedBorder EtchedBorder

Introduction

In this page you can find the example usage for javax.swing.border EtchedBorder EtchedBorder.

Prototype

public EtchedBorder(Color highlight, Color shadow) 

Source Link

Document

Creates a lowered etched border with the specified highlight and shadow colors.

Usage

From source file:cz.alej.michalik.totp.client.AddDialog.java

/**
 * Ov zda je sdlen heslo platn/*from   w ww  .  j a va 2 s.  c o  m*/
 * 
 * @param text
 * @return platnost
 */
private boolean verify(JTextField text) {
    System.out.println("Testuji retezec " + text.getText());
    // Pokud tda Base32 vrt kl? s nulovou dlkou, nen to platn kl?
    if (new Base32().decode(text.getText().getBytes()).length == 0) {
        System.out.println("Kl? nen platn");
        // Zvyraznim okraje
        text.setBorder(new EtchedBorder(new Color(255, 0, 0), new Color(250, 50, 50)));
        return false;
    }
    System.out.println("Kl? je platn");
    return true;
}

From source file:org.isatools.isacreator.filechooser.FileChooserUI.java

/**
 * Create the entire GUI// w  ww  .j  a v a2s .c om
 */
private void createGUI() {

    setPreferredSize(new Dimension(WIDTH, HEIGHT));
    setLayout(new BorderLayout());
    setAlwaysOnTop(true);
    setBackground(UIHelper.BG_COLOR);
    addWindowListener(this);
    setUndecorated(true);
    ((JComponent) getContentPane())
            .setBorder(new EtchedBorder(UIHelper.LIGHT_GREEN_COLOR, UIHelper.LIGHT_GREEN_COLOR));
    add(createTopPanel(), BorderLayout.NORTH);
    JPanel centralContainer = new JPanel(new GridLayout(1, 2));
    centralContainer.setBackground(UIHelper.BG_COLOR);
    centralContainer.add(createNavTree());
    centralContainer.add(createFilesSelectedPanel());
    add(centralContainer, BorderLayout.CENTER);
    add(createBottomPanel(), BorderLayout.SOUTH);

    pack();
}