Search in sources :

Example 6 with LineBorder

use of javax.swing.border.LineBorder in project binnavi by google.

the class TypeEditorPanel method createControls.

private void createControls(final TypeManager typeManager, final String caption) {
    setBounds(100, 100, 588, 529);
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new LineBorder(Color.LIGHT_GRAY, 1, true), caption));
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    add(new TypeEditorSearchPanel(typesTree), BorderLayout.NORTH);
    add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new BorderLayout(0, 0));
    {
        final JScrollPane scrollPane = new JScrollPane();
        contentPanel.add(scrollPane, BorderLayout.CENTER);
        {
            typesTree.addMouseListener(new TypeEditorMouseHandler(owner, typesTree, typeManager, this));
            typesTree.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0, true), "delete_types_or_members");
            typesTree.getActionMap().put("delete_types_or_members", new DeleteTypeOrMemberAction(owner, typeManager, this));
            scrollPane.setViewportView(typesTree);
        }
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) BorderLayout(java.awt.BorderLayout) LineBorder(javax.swing.border.LineBorder) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 7 with LineBorder

use of javax.swing.border.LineBorder in project jdk8u_jdk by JetBrains.

the class TestOldHangul method run.

private void run() {
    Font ourFont = null;
    // download from http://chem.skku.ac.kr/~wkpark/project/font/GSUB/UnbatangOdal/  and place in {user.home}/fonts/
    final String fontName = "UnBatangOdal.ttf";
    try {
        ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"), "fonts"), fontName));
        ourFont = ourFont.deriveFont((float) 48.0);
    } catch (Throwable t) {
        t.printStackTrace();
        System.err.println("Fail: " + t);
        return;
    }
    JFrame frame = new JFrame(System.getProperty("java.version"));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JTextArea label = new JTextArea("(empty)");
    label.setSize(400, 300);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(ourFont);
    final String str = "ᄊᆞᆷ ᄒᆞᆫ글 ᄀᆞᇹ ᄫᆞᆼ\n";
    if (AUTOMATIC_TEST) {
        /* run the test automatically (else, manually) */
        label.setText(str);
    } else {
        JButton button = new JButton("Old Hangul");
        button.addActionListener(new AbstractAction() {

            public void actionPerformed(ActionEvent actionEvent) {
                label.setText(str);
            }
        });
        panel.add(button);
    }
    panel.add(label);
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
Also used : ActionEvent(java.awt.event.ActionEvent) LineBorder(javax.swing.border.LineBorder)

Example 8 with LineBorder

use of javax.swing.border.LineBorder in project jdk8u_jdk by JetBrains.

the class Test4252164 method update.

private void update(int thickness) {
    this.thickness += thickness;
    this.rounded.setBorder(new LineBorder(Color.RED, this.thickness, true));
    this.straight.setBorder(new LineBorder(Color.RED, this.thickness, false));
}
Also used : LineBorder(javax.swing.border.LineBorder)

Example 9 with LineBorder

use of javax.swing.border.LineBorder in project jdk8u_jdk by JetBrains.

the class TestSinhalaChar method run.

private void run() {
    JFrame frame = new JFrame("Test Character (no crash = PASS)");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JLabel label = new JLabel("(empty)");
    label.setSize(400, 100);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(new Font("Lucida Bright", Font.PLAIN, 12));
    if (AUTOMATIC_TEST) {
        /* run the test automatically (else, manually) */
        label.setText(Character.toString('ෝ'));
    } else {
        JButton button = new JButton("Set Char x0DDD");
        button.addActionListener(new AbstractAction() {

            public void actionPerformed(ActionEvent actionEvent) {
                label.setText(Character.toString('ෝ'));
            }
        });
        panel.add(button);
    }
    panel.add(label);
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
Also used : ActionEvent(java.awt.event.ActionEvent) LineBorder(javax.swing.border.LineBorder)

Example 10 with LineBorder

use of javax.swing.border.LineBorder in project jdk8u_jdk by JetBrains.

the class TestTibetan method run.

private void run() {
    Font ourFont = null;
    try {
        //For best results: Font from:  http://download.savannah.gnu.org/releases/free-tibetan/jomolhari/
        // place in $(user.home)/fonts/
        ourFont = Font.createFont(Font.TRUETYPE_FONT, new java.io.File(new java.io.File(System.getProperty("user.home"), "fonts"), "Jomolhari-alpha3c-0605331.ttf"));
        //ourFont = new Font("serif",Font.PLAIN, 24);
        ourFont = ourFont.deriveFont((float) 24.0);
    } catch (Throwable t) {
        t.printStackTrace();
        System.err.println("Fail: " + t);
        return;
    }
    JFrame frame = new JFrame(System.getProperty("java.version"));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel panel = new JPanel();
    final JTextArea label = new JTextArea("(empty)");
    label.setSize(400, 300);
    label.setBorder(new LineBorder(Color.black));
    label.setFont(ourFont);
    // TinTin.
    final String str = "༄༅།། ཏིན་ཏིན་གྱི་དཔའ་རྩལ";
    if (AUTOMATIC_TEST) {
        /* run the test automatically (else, manually) */
        label.setText(str);
    } else {
        JButton button = new JButton("Set Char x0DDD");
        button.addActionListener(new AbstractAction() {

            public void actionPerformed(ActionEvent actionEvent) {
                label.setText(str);
            }
        });
        panel.add(button);
    }
    panel.add(label);
    frame.getContentPane().add(panel);
    frame.pack();
    frame.setVisible(true);
}
Also used : ActionEvent(java.awt.event.ActionEvent) LineBorder(javax.swing.border.LineBorder)

Aggregations

LineBorder (javax.swing.border.LineBorder)37 ActionEvent (java.awt.event.ActionEvent)9 CompoundBorder (javax.swing.border.CompoundBorder)9 Color (java.awt.Color)7 Border (javax.swing.border.Border)7 ActionListener (java.awt.event.ActionListener)6 JButton (javax.swing.JButton)6 EmptyBorder (javax.swing.border.EmptyBorder)6 Dimension (java.awt.Dimension)4 JLabel (javax.swing.JLabel)4 JScrollPane (javax.swing.JScrollPane)4 BorderLayout (java.awt.BorderLayout)3 Font (java.awt.Font)3 JTextField (javax.swing.JTextField)3 Tree (com.intellij.ui.treeStructure.Tree)2 Point (java.awt.Point)2 ItemEvent (java.awt.event.ItemEvent)2 ItemListener (java.awt.event.ItemListener)2 MouseEvent (java.awt.event.MouseEvent)2 IOException (java.io.IOException)2