com.sun.swingset3.utilities.RoundedBorder Java Examples

The following examples show how to use com.sun.swingset3.utilities.RoundedBorder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CodeViewer.java    From littleluck with Apache License 2.0 5 votes vote down vote up
protected JComponent createCodePanel() {
    
    JPanel panel = new RoundedPanel(new BorderLayout(), 10);
    panel.setBorder(new RoundedBorder(10));
    
    noCodeLabel = new JLabel(getString("CodeViewer.noCodeLoaded", "no code loaded"));
    noCodeLabel.setHorizontalAlignment(JLabel.CENTER);
    panel.add(noCodeLabel, BorderLayout.CENTER);
    return panel;
}
 
Example #2
Source File: SwingSet3.java    From littleluck with Apache License 2.0 5 votes vote down vote up
protected void displayErrorMessage(String message, Exception ex) {
    JPanel messagePanel = new JPanel(new BorderLayout());       
    JLabel label = new JLabel(message);
    messagePanel.add(label);
    if (ex != null) {
        RoundedPanel panel = new RoundedPanel(new BorderLayout());
        panel.setBorder(new RoundedBorder());
        
        // remind(aim): provide way to allow user to see exception only if desired
        StringWriter writer = new StringWriter();
        ex.printStackTrace(new PrintWriter(writer));
        JTextArea exceptionText = new JTextArea();
        exceptionText.setText("Cause of error:\n" +
                writer.getBuffer().toString());
        exceptionText.setBorder(new RoundedBorder());
        exceptionText.setOpaque(false);
        exceptionText.setBackground(
                Utilities.deriveColorHSB(UIManager.getColor("Panel.background"),
                0, 0, -.2f));
        JScrollPane scrollpane = new LuckScrollPane(exceptionText);
        scrollpane.setBorder(EMPTY_BORDER);
        scrollpane.setPreferredSize(new Dimension(600,240));
        panel.add(scrollpane);
        messagePanel.add(panel, BorderLayout.SOUTH);            
    }
    JOptionPane.showMessageDialog(getMainFrame(), messagePanel, 
            resourceMap.getString("error.title"),
            JOptionPane.ERROR_MESSAGE);
            
}
 
Example #3
Source File: CodeViewer.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
protected JComponent createCodePanel() {
    
    JPanel panel = new RoundedPanel(new BorderLayout(), 10);
    panel.setBorder(new RoundedBorder(10));
    
    noCodeLabel = new JLabel(getString("CodeViewer.noCodeLoaded", "no code loaded"));
    noCodeLabel.setHorizontalAlignment(JLabel.CENTER);
    panel.add(noCodeLabel, BorderLayout.CENTER);
    return panel;
}
 
Example #4
Source File: SwingSet3.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
protected void displayErrorMessage(String message, Exception ex) {
    JPanel messagePanel = new JPanel(new BorderLayout());       
    JLabel label = new JLabel(message);
    messagePanel.add(label);
    if (ex != null) {
        RoundedPanel panel = new RoundedPanel(new BorderLayout());
        panel.setBorder(new RoundedBorder());
        
        // remind(aim): provide way to allow user to see exception only if desired
        StringWriter writer = new StringWriter();
        ex.printStackTrace(new PrintWriter(writer));
        JTextArea exceptionText = new JTextArea();
        exceptionText.setText("Cause of error:\n" +
                writer.getBuffer().toString());
        exceptionText.setBorder(new RoundedBorder());
        exceptionText.setOpaque(false);
        exceptionText.setBackground(
                Utilities.deriveColorHSB(UIManager.getColor("Panel.background"),
                0, 0, -.2f));
        JScrollPane scrollpane = new JScrollPane(exceptionText);
        scrollpane.setBorder(EMPTY_BORDER);
        scrollpane.setPreferredSize(new Dimension(600,240));
        panel.add(scrollpane);
        messagePanel.add(panel, BorderLayout.SOUTH);            
    }
    JOptionPane.showMessageDialog(getMainFrame(), messagePanel, 
            resourceMap.getString("error.title"),
            JOptionPane.ERROR_MESSAGE);
            
}
 
Example #5
Source File: CodeViewer.java    From Darcula with Apache License 2.0 5 votes vote down vote up
protected JComponent createCodePanel() {
    
    JPanel panel = new RoundedPanel(new BorderLayout(), 10);
    panel.setBorder(new RoundedBorder(10));
    
    noCodeLabel = new JLabel(getString("CodeViewer.noCodeLoaded", "no code loaded"));
    noCodeLabel.setHorizontalAlignment(JLabel.CENTER);
    panel.add(noCodeLabel, BorderLayout.CENTER);
    return panel;
}
 
Example #6
Source File: SwingSet3.java    From Darcula with Apache License 2.0 5 votes vote down vote up
protected void displayErrorMessage(String message, Exception ex) {
    JPanel messagePanel = new JPanel(new BorderLayout());       
    JLabel label = new JLabel(message);
    messagePanel.add(label);
    if (ex != null) {
        RoundedPanel panel = new RoundedPanel(new BorderLayout());
        panel.setBorder(new RoundedBorder());
        
        // remind(aim): provide way to allow user to see exception only if desired
        StringWriter writer = new StringWriter();
        ex.printStackTrace(new PrintWriter(writer));
        JTextArea exceptionText = new JTextArea();
        exceptionText.setText("Cause of error:\n" +
                writer.getBuffer().toString());
        exceptionText.setBorder(new RoundedBorder());
        exceptionText.setOpaque(false);
        exceptionText.setBackground(
                Utilities.deriveColorHSB(UIManager.getColor("Panel.background"),
                0, 0, -.2f));
        JScrollPane scrollpane = new JScrollPane(exceptionText);
        scrollpane.setBorder(EMPTY_BORDER);
        scrollpane.setPreferredSize(new Dimension(600,240));
        panel.add(scrollpane);
        messagePanel.add(panel, BorderLayout.SOUTH);            
    }
    JOptionPane.showMessageDialog(getMainFrame(), messagePanel, 
            resourceMap.getString("error.title"),
            JOptionPane.ERROR_MESSAGE);
            
}