Java Code Examples for javax.swing.BorderFactory

The following examples show how to use javax.swing.BorderFactory. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: visualvm   Source File: OverviewViewSupport.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void initComponents(final ApplicationOverviewModel model) {
    setLayout(new BorderLayout());
    setOpaque(false);
    
    final HTMLTextArea area = new HTMLTextArea("<nobr>" + getGeneralProperties(model) + "</nobr>"); // NOI18N
    area.setBorder(BorderFactory.createEmptyBorder(14, 8, 14, 8));
    
    DataSource source = model.getSource();
    if (source instanceof Application) {
        oomeListener = new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                if (Jvm.PROPERTY_DUMP_OOME_ENABLED.equals(evt.getPropertyName())) {
                    int selStart = area.getSelectionStart();
                    int selEnd   = area.getSelectionEnd();
                    area.setText("<nobr>" + getGeneralProperties(model) + "</nobr>");   // NOI18N
                    area.select(selStart, selEnd);
                }
            }
        };
        Jvm jvm = JvmFactory.getJVMFor((Application)source);
        jvm.addPropertyChangeListener(WeakListeners.propertyChange(oomeListener,jvm));
    }
    add(area, BorderLayout.CENTER);
}
 
Example 2
Source Project: netbeans   Source File: SectionPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void addAction (Action action) {
    String name = (String) action.getValue(Action.NAME);
    LinkButton btn = new LinkButton(name);
    btn.addActionListener(action);
    
    if (notEmpty) {
        JLabel separator = new javax.swing.JLabel();
        separator.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createEmptyBorder(2, 0, 2, 0),
                BorderFactory.createLineBorder(Color.BLACK, 1)
        ));
        horizontalSeqGroup
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(separator)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
        verticalParallelGroup
            .addComponent(separator, GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
    }
    
    horizontalSeqGroup
            .addComponent(btn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    verticalParallelGroup
            .addComponent(btn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
    notEmpty = true;
}
 
Example 3
/**
 * Create Component(JPanel) and add separator and JLabel to it.
 *
 * @param cell JLabel
 * @return panel
 */
private Component panelWithSeparator(JLabel cell) {
    // create separator
    JSeparator separator = new JSeparator(SwingConstants.VERTICAL) {
        private static final long serialVersionUID = -6385848933295984637L;

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(3, 3);
        }
    };
    separator.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));

    // create panel
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(separator, BorderLayout.WEST);
    panel.add(cell, BorderLayout.EAST);
    panel.add(versionLabel, BorderLayout.CENTER);
    return panel;
}
 
Example 4
private JPanel createPlotPanel() {
    JPanel plotPanel = new JPanel(new LCBLayout(3));
    plotPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    plotPanel.add(new JLabel(localizationResources.getString(
            "AngleOffset")));
    this.angleOffset = new JTextField(Double.toString(
            this.angleOffsetValue));
    this.angleOffset.setActionCommand("AngleOffsetValue");
    this.angleOffset.addActionListener(this);
    this.angleOffset.addFocusListener(this);
    plotPanel.add(this.angleOffset);
    plotPanel.add(new JPanel());

    plotPanel.add(new JLabel(localizationResources.getString(
            "Manual_TickUnit_value")));
    this.manualTickUnit = new JTextField(Double.toString(
            this.manualTickUnitValue));
    this.manualTickUnit.setActionCommand("TickUnitValue");
    this.manualTickUnit.addActionListener(this);
    this.manualTickUnit.addFocusListener(this);
    plotPanel.add(this.manualTickUnit);
    plotPanel.add(new JPanel());

    return plotPanel;
}
 
Example 5
Source Project: visualvm   Source File: JavaOverviewSummary.java    License: GNU General Public License v2.0 6 votes vote down vote up
HorizontalScroller(JComponent view) {
    super(view, VERTICAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_AS_NEEDED);

    setBorder(BorderFactory.createEmptyBorder());
    setViewportBorder(BorderFactory.createEmptyBorder());

    getViewport().setOpaque(false);
    setOpaque(false);
    
    super.addMouseWheelListener(new MouseWheelListener() {
        @Override
        public void mouseWheelMoved(MouseWheelEvent e) {
            if (e.getModifiers() == MouseWheelEvent.SHIFT_MASK) {
                scroll(getHorizontalScrollBar(), e);
            } else {
                getParent().dispatchEvent(e);
            }
        }
        
    });
}
 
Example 6
Source Project: visualvm   Source File: ThreadDumpWindow.java    License: GNU General Public License v2.0 6 votes vote down vote up
public ThreadDumpWindow(ThreadDump td) {
    setLayout(new BorderLayout());
    setFocusable(true);
    setRequestFocusEnabled(true);
    setName(Bundle.ThreadDumpWindow_Caption(StringUtils.formatUserDate(td.getTime())));
    setIcon(Icons.getImage(ProfilerIcons.THREAD));

    StringBuilder text = new StringBuilder();
    printThreads(text, td);
    a = new HTMLTextArea() {
        protected void showURL(URL url) {
            if (url == null) {
                return;
            }
            String urls = url.toString();
            ThreadDumpWindow.this.showURL(urls);
        }
    };
    a.setEditorKit(new CustomHtmlEditorKit());
    a.setText(text.toString());
    a.setCaretPosition(0);
    JScrollPane sp = new JScrollPane(a);
    sp.setBorder(BorderFactory.createEmptyBorder());
    sp.setViewportBorder(BorderFactory.createEmptyBorder());
    add(sp, BorderLayout.CENTER);
}
 
Example 7
Source Project: Swing9patch   Source File: NPComponentUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new N9Component object.
 *
 * @param text the text
 * @param n9 the n9
 * @param is the is
 * @param foregroundColor the foreground color
 * @param f the f
 * @return the j label
 */
public static JLabel createLabel_root(String text
		, final NinePatch n9, Insets is
		, Color foregroundColor, Font f)
{
	JLabel l = new JLabel(text){
		public void paintComponent(Graphics g) {
			n9.draw((Graphics2D)g, 0, 0, this.getWidth(), this.getHeight());
			super.paintComponent(g);
		}
	};
	if(is != null)
		l.setBorder(BorderFactory.createEmptyBorder(is.top, is.left, is.bottom, is.right));
	if(foregroundColor != null)
		l.setForeground(foregroundColor);
	if(f != null)
		l.setFont(f);

	return l;
}
 
Example 8
Source Project: lucene-solr   Source File: LogsPanelProvider.java    License: Apache License 2.0 6 votes vote down vote up
public JPanel get() {
  JPanel panel = new JPanel(new BorderLayout());
  panel.setOpaque(false);
  panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));

  JPanel header = new JPanel(new FlowLayout(FlowLayout.LEADING));
  header.setOpaque(false);
  header.add(new JLabel(MessageUtils.getLocalizedMessage("logs.label.see_also")));

  JLabel logPathLabel = new JLabel(LukeMain.LOG_FILE);
  header.add(logPathLabel);

  panel.add(header, BorderLayout.PAGE_START);

  panel.add(new JScrollPane(logTextArea), BorderLayout.CENTER);
  return panel;
}
 
Example 9
private JPanel createGlobalScriptTab() {
  final JPanel globalHeader2 = new JPanel( new BorderLayout() );
  globalHeader2.add( new JLabel( Messages.getString( "QueryEditorPanel.GlobalScript" ) ), BorderLayout.CENTER );
  globalHeader2.add( new JButton( globalTemplateAction ), BorderLayout.EAST );

  final JPanel globalScriptHeader = new JPanel( new VerticalLayout( 5, VerticalLayout.BOTH, VerticalLayout.TOP ) );
  globalScriptHeader.add( new JLabel( Messages.getString( "QueryEditorPanel.GlobalScriptLanguage" ) ) );
  globalScriptHeader.add( globalLanguageField );
  globalScriptHeader.add( globalHeader2 );

  final JPanel globalScriptContentHolder = new JPanel( new BorderLayout() );
  globalScriptContentHolder.add( globalScriptHeader, BorderLayout.NORTH );
  globalScriptContentHolder.add( new RTextScrollPane( 700, 600, globalScriptTextArea, true ), BorderLayout.CENTER );
  globalScriptContentHolder.setBorder( BorderFactory.createEmptyBorder( 8, 8, 8, 8 ) );
  return globalScriptContentHolder;
}
 
Example 10
Source Project: Spark   Source File: TranscriptAlert.java    License: Apache License 2.0 6 votes vote down vote up
public TranscriptAlert() {
    setLayout(new GridBagLayout());

    setBackground(new Color(250, 249, 242));
    add(imageLabel, new GridBagConstraints(0, 0, 1, 3, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));

    add(titleLabel, new GridBagConstraints(1, 0, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    titleLabel.setFont(new Font("Dialog", Font.BOLD, 11));
    titleLabel.setForeground(new Color(211, 174, 102));

    add(yesButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
    add(cancelButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));

    yesButton.setForeground(new Color(73, 113, 196));
    cancelButton.setForeground(new Color(73, 113, 196));

    cancelButton.setFont(new Font("Dialog", Font.BOLD, 10));
    yesButton.setFont(new Font("Dialog", Font.BOLD, 10));

    yesButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));
    cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196)));

    cancelButton.setVisible(false);
    setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.white));
}
 
Example 11
Source Project: dkpro-jwpl   Source File: LoggingPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void createDiffToolLoggingSettings()
{
	diffToolLabel = new JLabel("Logging Root Folder: ");
	diffToolLabel.setBorder(BorderFactory.createRaisedBevelBorder());
	diffToolLabel.setBounds(10, 10, 150, 25);
	this.add(diffToolLabel);

	diffToolField = new JTextField();
	diffToolField.setBounds(170, 10, 200, 25);
	this.add(diffToolField);

	diffToolLogLevelComboBox = new JComboBox<>();
	diffToolLogLevelComboBox.setBounds(390, 10, 100, 25);

	diffToolLogLevelComboBox.addItem(Level.ERROR);
	diffToolLogLevelComboBox.addItem(Level.WARN);
	diffToolLogLevelComboBox.addItem(Level.INFO);
	diffToolLogLevelComboBox.addItem(Level.DEBUG);
	diffToolLogLevelComboBox.addItem(Level.TRACE);

	this.add(diffToolLogLevelComboBox);
}
 
Example 12
Source Project: mqtt-jmeter   Source File: PubSamplerUI.java    License: Apache License 2.0 6 votes vote down vote up
private JPanel createPubOption() {
	JPanel optsPanelCon = new VerticalPanel();
	optsPanelCon.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Pub options"));

	qosChoice = new JLabeledChoice("QoS Level:", new String[] { String.valueOf(QOS_0), String.valueOf(QOS_1), String.valueOf(QOS_2) }, true, false);
	qosChoice.addChangeListener(this);

	JPanel optsPanel = new HorizontalPanel();
	optsPanel.add(qosChoice);
	optsPanel.add(retainedMsg);
	optsPanel.add(topicName);
	topicName.setToolTipText("Name of topic that the message will be sent to.");
	optsPanel.add(timestamp);
	optsPanelCon.add(optsPanel);

	return optsPanelCon;
}
 
Example 13
Source Project: stendhal   Source File: StyleFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
Style create() {
	// Text
	Color highlight = new Color(219, 191, 130);
	Color shadow = new Color(36, 14, 0); // Light brown (also inactive text)
	PixmapStyle style = new PixmapStyle("data/gui/panel_brick_brown_001.png",
			false, highlight, shadow, Color.white, Color.white);
	// Border
	Color blightin = new Color(181, 140, 50);
	Color bshadowin = new Color(98, 47, 15);
	style.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED,
			highlight, blightin, shadow, bshadowin));
	style.setBorderDown(BorderFactory.createBevelBorder(BevelBorder.LOWERED,
			highlight, blightin, shadow, bshadowin));
	return style;
}
 
Example 14
Source Project: netbeans   Source File: ResultPanelTree.java    License: Apache License 2.0 6 votes vote down vote up
ResultPanelTree(ResultDisplayHandler displayHandler, StatisticsPanel statPanel) {
        super(new BorderLayout());
        treeView = new ResultTreeView();
        treeView.getAccessibleContext().setAccessibleName(Bundle.ACSN_TestResults());
        treeView.getAccessibleContext().setAccessibleDescription(Bundle.ACSD_TestResults());
        treeView.setBorder(BorderFactory.createEtchedBorder());
//        resultBar.setPassedPercentage(0.0f);
        JToolBar toolBar = new JToolBar();
        toolBar.setFloatable(false);
        toolBar.add(resultBar);
        toolBar.setBorder(BorderFactory.createEtchedBorder());

        add(toolBar, BorderLayout.NORTH);
        add(treeView, BorderLayout.CENTER);

        explorerManager = new ExplorerManager();
        explorerManager.setRootContext(rootNode = new RootNode(displayHandler.getSession(), filterMask));
        explorerManager.addPropertyChangeListener(this);

        initAccessibility();

        this.displayHandler = displayHandler;
        this.statPanel = statPanel;
        displayHandler.setLookup(ExplorerUtils.createLookup(explorerManager, new ActionMap()));
    }
 
Example 15
Source Project: visualvm   Source File: UISupport.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates preformatted instance of ScrollableContainer to be used in Options
 * dialog. All insets are already initialized to defaults, the client components
 * should have zero outer insets.
 * 
 * @param contents component to be displayed
 * @return preformatted instance of ScrollableContainer
 */
public static ScrollableContainer createScrollableContainer(JComponent contents) {
    ScrollableContainer container = new ScrollableContainer(contents,
                                    JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                    JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    container.setViewportBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
    container.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 5));
    return container;
}
 
Example 16
Source Project: libreveris   Source File: UIUtil.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Report a standard tool border entity, which is a blank border.
 *
 * @return the standard tool border
 */
public static Border getToolBorder ()
{
    if (toolBorder == null) {
        toolBorder = BorderFactory.createEmptyBorder(1, 2, 1, 2);
    }

    return toolBorder;
}
 
Example 17
Source Project: netbeans   Source File: BrowserMenu.java    License: Apache License 2.0 5 votes vote down vote up
public void show( JComponent invoker, int x, int y ) {
    JPanel panel = new JPanel();
    panel.setOpaque( false );
    fillContent( panel );

    popup = new JPopupMenu();
    popup.add( panel );
    if( windowsLaF ) {
        popup.setBorder( BorderFactory.createLineBorder( windowsSeparatorColor.darker() ));
    }
    popup.show( invoker, x, y );
}
 
Example 18
Source Project: gameserver   Source File: ManageAccountStatusDialog.java    License: Apache License 2.0 5 votes vote down vote up
public void init() {
	this.setTitle("管理账户状态");
	this.setSize(320, 430);
	Point p = WindowUtils.getPointForCentering(this);
	this.setLocation(p);
	this.setModal(true);
	this.statusField.setActionCommand(CMD_STATUS_SELECT);
	this.statusField.addActionListener(this);
	this.statusField.setSelectedIndex(0);
	
	this.okButton.setActionCommand(ActionName.OK.name());
	this.okButton.addActionListener(this);
	this.cancelButton.setActionCommand(ActionName.CANCEL.name());
	this.cancelButton.addActionListener(this);
	this.previewButton.setActionCommand(CMD_PREVIEW);
	this.previewButton.addActionListener(this);
	
	JXPanel loginPanel = new JXPanel(new MigLayout("wrap 2, gap 10px", "[45%][55%]"));
	loginPanel.add(this.statusLabel, "sg lbl");
	loginPanel.add(this.statusField, "sg fd, grow");
	loginPanel.add(this.descField, "span, grow");
	loginPanel.add(this.previewButton, "gaptop 5px, span, split 3, align center");		
	loginPanel.setBorder(BorderFactory.createTitledBorder("登陆管理"));
					
	JXPanel panel = new JXPanel(new MigLayout("wrap 1, gap 10px", "[100%]"));
	this.setLayout(new MigLayout("wrap 1"));
	panel.add(loginPanel);
	panel.add(this.okButton, "gaptop 5px, span, split 3, align center");
	panel.add(this.cancelButton);

	this.add(panel, "width 100%, height 100%");
}
 
Example 19
Source Project: jpexs-decompiler   Source File: ColorEditor.java    License: GNU General Public License v3.0 5 votes vote down vote up
public ColorEditor(String fieldName, Object obj, Field field, int index, Class<?> type) {
    this.obj = obj;
    this.field = field;
    this.index = index;
    this.type = type;
    this.fieldName = fieldName;

    setLayout(new FlowLayout());

    buttonChange = new JButton("") {

        @Override
        protected void paintComponent(Graphics g) {
            g.setColor(getBackground());
            g.fillRect(0, 0, getWidth(), getHeight());
            super.paintBorder(g);
        }

    };
    buttonChange.setToolTipText(AppStrings.translate("button.selectcolor.hint"));
    buttonChange.setCursor(new Cursor(Cursor.HAND_CURSOR));
    buttonChange.addActionListener(this);

    buttonChange.setBorderPainted(true);
    buttonChange.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
    Dimension colorDim = new Dimension(16, 16);
    buttonChange.setSize(colorDim);
    buttonChange.setPreferredSize(colorDim);
    add(buttonChange);
    reset();
}
 
Example 20
/**
 * Returns a panel that appears at the bottom of the calendar panel - 
 * contains a button for selecting today's date.
 *
 * @return the panel.
 */
private JPanel constructControlPanel() {

    final JPanel p = new JPanel();
    p.setBorder(BorderFactory.createEmptyBorder(2, 5, 2, 5));
    this.todayButton = new JButton("Today");
    this.todayButton.addActionListener(this);
    this.todayButton.setActionCommand("todayButtonClicked");
    p.add(this.todayButton);
    return p;

}
 
Example 21
Source Project: netbeans   Source File: ProfilerToolbar.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Component add(ProfilerToolbar toolbar, int index) {
    JToolBar implToolbar = ((Impl)toolbar).toolbar;
    implToolbar.setBorder(BorderFactory.createEmptyBorder());
    implToolbar.setOpaque(false);
    implToolbar.putClientProperty("Toolbar.noGTKBorder", Boolean.TRUE); // NOI18N
    return add(implToolbar, index);
}
 
Example 22
Source Project: mqtt-jmeter   Source File: CommonConnUI.java    License: Apache License 2.0 5 votes vote down vote up
public JPanel createAuthentication() {
	JPanel optsPanelCon = new VerticalPanel();
	optsPanelCon.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "User authentication"));
	
	JPanel optsPanel = new HorizontalPanel();
	optsPanel.add(userNameAuth);
	optsPanel.add(passwordAuth);
	optsPanelCon.add(optsPanel);
	
	return optsPanelCon;
}
 
Example 23
Source Project: tmc-intellij   Source File: SuccessfulSubmissionDialog.java    License: MIT License 5 votes vote down vote up
public SuccessfulSubmissionDialog(Exercise exercise, SubmissionResult result, Project project) {
    logger.info("Creating SuccessfulSubmissionDialog. @SuccessfulSubmissionDialog");
    this.setTitle(exercise.getName() + " passed");

    JPanel contentPane = new JPanel();
    contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    setContentPane(contentPane);

    addYayLabel();
    addVSpace(6);

    if (exercise.requiresReview() && !result.getMissingReviewPoints().isEmpty()) {
        addRequiresReviewLabels();
    }

    addVSpace(6);
    addPointsLabel(result);
    addVSpace(10);
    addModelSolutionButton(result, project);
    addVSpace(20);
    addFeedbackQuestions(result); // TODO: maybe put in box
    addVSpace(10);
    addOkButton();
    addNextExerciseButton();
    addNextExerciseListener(result, project);
    addOkListener(result, project);
    setAlwaysOnTop(true);

    pack();
    this.setLocationRelativeTo(null);
    this.setVisible(true);
    this.requestFocusInWindow(true);
}
 
Example 24
Source Project: JCEditor   Source File: ButtonTabComponent.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ButtonTabComponent(final JTabbedPane pane, ArrayList<AreaDeTexto> adts, ArrayList<String> arqsAbertos) {
    //unset default FlowLayout' gaps
    super(new FlowLayout(FlowLayout.LEFT, 0, 0));
    if (pane == null) {
        throw new NullPointerException("");
    }
    this.pane = pane;
    this.adts = adts;
    this.arquivosAbertos = arqsAbertos;
    setOpaque(false);
    
    //make JLabel read titles from JTabbedPane
    JLabel label = new JLabel() {
        public String getText() {
            int i = pane.indexOfTabComponent(ButtonTabComponent.this);
            if (i != -1) {
                return pane.getTitleAt(i);
            }
            return null;
        }
    };
    
    add(label);
    //add more space between the label and the button
    label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
    //tab button
    JButton button = new TabButton();
    add(button);
    //add more space to the top of the component
    setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
}
 
Example 25
Source Project: TrakEM2   Source File: StdOutWindow.java    License: GNU General Public License v3.0 5 votes vote down vote up
private Component wrap(Component c, String title) {
	JScrollPane s = new JScrollPane(c);
	s.setBackground(Color.white);
	s.setMinimumSize(new Dimension(400,15));
	s.setPreferredSize(new Dimension(400,200));
	s.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(0,5,0,5), title));
	return s;
}
 
Example 26
Source Project: sldeditor   Source File: MapRender.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates the map pane.
 *
 * @return the j map pane
 */
private SLDMapPane createMapPane() {
    SLDMapPane internalMapPane = new SLDMapPane();
    internalMapPane.setBackground(
            PrefManager.getInstance().getPrefData().getBackgroundColour());
    internalMapPane.setBorder(BorderFactory.createLineBorder(Color.BLACK));

    return internalMapPane;
}
 
Example 27
Source Project: visualvm   Source File: BorderBuilders.java    License: GNU General Public License v2.0 5 votes vote down vote up
protected Border createInstanceImpl() {
    Insets i = insets.createInstance();
    if (i.top == 0 && i.left == 0 && i.bottom == 0 && i.right == 0) {
        return BorderFactory.createEmptyBorder();
    } else {
        return BorderFactory.createEmptyBorder(i.top, i.left, i.bottom, i.right);
    }
}
 
Example 28
Source Project: magarena   Source File: FilterButton.java    License: GNU General Public License v3.0 5 votes vote down vote up
void setActiveFlag(boolean isActive) {
    setFont(isActive ? ON_FONT : OFF_FONT);
    setBorder(isActive 
            ? BorderFactory.createMatteBorder(2, 2, 2, 2, MagicStyle.getRolloverColor())
            : null
    );
}
 
Example 29
Source Project: visualvm   Source File: OQLEditorComponent.java    License: GNU General Public License v2.0 5 votes vote down vote up
public void clearScrollBorders() {
    if (getComponentCount() > 0) {
        Component c = getComponent(0);
        if (c instanceof JScrollPane) {
            ((JScrollPane)c).setBorder(BorderFactory.createEmptyBorder());
            ((JScrollPane)c).setViewportBorder(BorderFactory.createEmptyBorder());
        }
    }
}
 
Example 30
/**
 * No -arguments constructor.
 */
public LegendBuilder() {
	legendPanel = new JPanel();
	legendPanel.setLayout(new BoxLayout(legendPanel, BoxLayout.Y_AXIS));
	border = BorderFactory.createTitledBorder("Legend");
	legendPanel.setBorder(border);
}