當前位置: 首頁>>代碼示例>>Java>>正文


Java BorderFactory.createLineBorder方法代碼示例

本文整理匯總了Java中javax.swing.BorderFactory.createLineBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java BorderFactory.createLineBorder方法的具體用法?Java BorderFactory.createLineBorder怎麽用?Java BorderFactory.createLineBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.BorderFactory的用法示例。


在下文中一共展示了BorderFactory.createLineBorder方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DataTableColumnListCellRenderer

import javax.swing.BorderFactory; //導入方法依賴的package包/類
public DataTableColumnListCellRenderer() {

		container = new JPanel(new GridBagLayout());

		tableColumnLabel = new JLabel();

		focusBorder = BorderFactory.createLineBorder(BORDER_SELECTION_COLOR);
		noFocusBorder = BorderFactory.createLineBorder(Color.WHITE);

		GridBagConstraints itemConstraint = new GridBagConstraints();
		itemConstraint.insets = new Insets(2, 1, 2, 1);
		itemConstraint.anchor = GridBagConstraints.WEST;
		itemConstraint.weightx = 1;
		itemConstraint.fill = GridBagConstraints.HORIZONTAL;

		container.add(tableColumnLabel, itemConstraint);
	}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:18,代碼來源:DataTableColumnListCellRenderer.java

示例2: jbInit

import javax.swing.BorderFactory; //導入方法依賴的package包/類
private void jbInit() throws Exception {
  border1 = BorderFactory.createLineBorder(Color.gray,1);
  this.setClosable(true);
  this.setTitle(Local.getString("Select date"));
  this.setBorder(border1);
  //this.setPreferredSize(new Dimension(200, 200));
  this.setToolTipText("");
  cal.setPreferredSize(new Dimension(this.getContentPane().getWidth(),
  this.getContentPane().getHeight()));
  this.getContentPane().add(cal,  BorderLayout.CENTER);
}
 
開發者ID:ser316asu,項目名稱:Neukoelln_SER316,代碼行數:12,代碼來源:CalendarFrame.java

示例3: setFullyEditable

import javax.swing.BorderFactory; //導入方法依賴的package包/類
/**
 * Sets all the cells in the <code>ETable</code> to be editable if
 * <code>fullyEditable</code> is true.
 * if <code>fullyEditable</code> is false, sets the table cells into
 * their default state as in JTable.
 *
 * @param   fullyEditable   true if the table is meant to be fully editable.
 *                          false if the table is meant to take the defalut
 *                          state for editing.
 * @see #isFullyEditable()
 */
public void setFullyEditable(boolean fullyEditable) {
    if (fullyEditable) {
        editing = FULLY_EDITABLE;
        if(!getShowHorizontalLines()) {
            setShowHorizontalLines(true);
        }
        Color colorBorderAllEditable = UIManager.getColor("Table.borderAllEditable");
        Border border = null;
        if (colorBorderAllEditable != null) {
            border = BorderFactory.createLineBorder(colorBorderAllEditable);
        } else {
            border = BorderFactory.createLineBorder(Color.GRAY);
        }
        Border filler = BorderFactory.createLineBorder(getBackground());
        CompoundBorder compound = new CompoundBorder(border, filler);
        setBorder(new CompoundBorder(compound, border));
    } else {
        editing = DEFAULT;
        setBorder( null );
    }
    Color c = UIManager.getColor("Table.defaultGrid");
    if (c != null) {
        setGridColor(c);
    }
    if (isFullyNonEditable()) {
        setupSearch();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:40,代碼來源:ETable.java

示例4: init

import javax.swing.BorderFactory; //導入方法依賴的package包/類
private void init() {
    Border b = UIManager.getBorder( "nb.popupswitcher.border" ); //NOI18N
    if( null == b )
        b = BorderFactory.createLineBorder(getForeground());
    setBorder(b);
    setShowHorizontalLines(false);
    // Calc row height here so that TableModel can adjust number of columns.
    calcRowHeight(getOffscreenGraphics());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:SwitcherTable.java

示例5: PopupPane

import javax.swing.BorderFactory; //導入方法依賴的package包/類
PopupPane(Component content, boolean resize) {
    super(new BorderLayout());
    add(content, BorderLayout.CENTER);
    
    setFocusCycleRoot(true);
    setFocusTraversalPolicyProvider(true);
    setFocusTraversalPolicy(new PopupFocusTraversalPolicy());
    
    if (UIUtils.isAquaLookAndFeel()) {
        if (resize) {
            setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
            addMouseListener(this);
            addMouseMotionListener(this);
        }
    } else {
        Border border = BorderFactory.createLineBorder(UIUtils.getDisabledLineColor());
        
        if (resize) {
            setBorder(BorderFactory.createCompoundBorder(border,
                      BorderFactory.createEmptyBorder(8, 8, 8, 8)));
            addMouseListener(this);
            addMouseMotionListener(this);
        } else {
            setBorder(border);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:ProfilerPopup.java

示例6: getQuickSearchBorder

import javax.swing.BorderFactory; //導入方法依賴的package包/類
/**
 * Get customizable border for QuickSearch. See bug 246907.
 *
 * @return Custom border if defined in {@link UIManager} or default line
 * border.
 */
private Border getQuickSearchBorder() {
    Border border = UIManager.getBorder("nb.quicksearch.border"); //NOI18N
    return border != null
            ? border
            : BorderFactory.createLineBorder(getComboBorderColor());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:QuickSearchComboBar.java

示例7: MyJPanel

import javax.swing.BorderFactory; //導入方法依賴的package包/類
public MyJPanel( String title, Color color ) {
	super();
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));		
	setBackground(Color.WHITE);
	Border redline = BorderFactory.createLineBorder(color);
	Border compound = BorderFactory.createTitledBorder(redline, title );
	setBorder( compound );
	//			setBorder(Border.)
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:10,代碼來源:RankingDemo.java

示例8: AttributeDropTextField

import javax.swing.BorderFactory; //導入方法依賴的package包/類
public AttributeDropTextField(JTree plotConfigurationTree, DataTableColumnListTransferHandler th, SeriesUsageType type) {
	th.addDragListener(this);

	this.setFocusable(false);
	this.setEditable(false);
	this.setBackground(Color.white);
	this.setTransferHandler(new DataTableColumnDropTextFieldTransferHandler(plotConfigurationTree, type, this));

	ongoingDropBorder = BorderFactory.createLineBorder(ProcessDrawer.BORDER_DRAG_COLOR, 1);
	dropEndedBorder = BorderFactory.createEmptyBorder(1, 1, 1, 1);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:12,代碼來源:AttributeDropTextField.java

示例9: jbInit

import javax.swing.BorderFactory; //導入方法依賴的package包/類
/**
 * Sets up calendar frame.
 * @throws Exception
 */
private void jbInit() throws Exception {
  border1 = BorderFactory.createLineBorder(ColorMap.CALENDARFRAMEBORDER,1);
  this.setClosable(true);
  this.setTitle(Local.getString("Select date"));
  this.setBorder(border1);
  //this.setPreferredSize(new Dimension(200, 200));
  this.setToolTipText("");
  cal.setPreferredSize(new Dimension(this.getContentPane().getWidth(),
  this.getContentPane().getHeight()));
  this.getContentPane().add(cal,  BorderLayout.CENTER);
  this.setResizable(Configuration.get("RESIZABLE_WINDOW").equals("yes"));
}
 
開發者ID:ser316asu,項目名稱:SER316-Dresden,代碼行數:17,代碼來源:CalendarFrame.java

示例10: getToolTipBorder

import javax.swing.BorderFactory; //導入方法依賴的package包/類
/**
 * Returns the border used by tool tips in this look and feel.
 *
 * @return The border.
 */
public static Border getToolTipBorder() {

	Border border = UIManager.getBorder("ToolTip.border");

	if (border==null || isNimbusLookAndFeel()) {
		border = UIManager.getBorder("nimbusBorder");
		if (border==null) {
			border = BorderFactory.createLineBorder(SystemColor.controlDkShadow);
		}
	}

	return border;

}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:20,代碼來源:TipUtil.java

示例11: ParameterControlPanel

import javax.swing.BorderFactory; //導入方法依賴的package包/類
/** Builds a new panel around the Object f. Any properties of the Object (defined by matching <code>setX/getX</code> methods)
     * are added to the panel. If the object implements {@link HasPropertyTooltips} then a tooltip is added for the property if the 
     * {@link HasPropertyTooltips#getPropertyTooltip(java.lang.String) } returns a non-null String property.
     * 
     * @param obj the object
     */
    public ParameterControlPanel(Object obj) {
        setClazz(obj);
        initComponents();
        String cn = getClazz().getClass().getName();
        int lastdot = cn.lastIndexOf('.');
        String name = cn.substring(lastdot + 1);
        setName(name);
        titledBorder = new TitledBorder(name);
        titledBorder.getBorderInsets(this).set(1, 1, 1, 1);
        setBorder(titledBorder);
        normalBorder = titledBorder.getBorder();
        redLineBorder = BorderFactory.createLineBorder(Color.red);
        addIntrospectedControls();
//            add(new JPanel()); // to fill vertical space in GridLayout
            add(Box.createVerticalGlue()); // to fill space at bottom - not needed
        try {
            // when clazz fires a property change event, propertyChangeEvent is called here and we refresh all our controls
            Method m=obj.getClass().getMethod("getPropertyChangeSupport", (Class[])null);
            support=(PropertyChangeSupport)m.invoke(obj, (Object[]) null);
            support.addPropertyChangeListener(this);
        } catch (Exception ex) {
            
        } 
//            if(f instanceof PropertyChangeListener){
//        ((PropertyChangeListener)f).getPropertyChangeSupport().addPropertyChangeListener(this);
//                }
        ToolTipManager.sharedInstance().setDismissDelay(10000); // to show tips
        revalidate();
    }
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:36,代碼來源:ParameterControlPanel.java

示例12: Console

import javax.swing.BorderFactory; //導入方法依賴的package包/類
public Console() {
	console = new JTextArea();
	clearButton = new JButton("Clear");
	//exportButton = new JButton("Export");
	setPanelTitle(PANEL_TITLE);

	clearButton.addActionListener(new ClearListener());
	//exportButton.addActionListener(new ExportListener());
	
	JPanel buttonsPanel = new JPanel();
	buttonsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
	buttonsPanel.add(clearButton);
	//buttonsPanel.add(exportButton);
	
	console.setFont(new Font(CONSOLE_STYLE, Font.PLAIN, FONT_SIZE));
	//console.setRows(NROWS);
	console.setEditable(false);
	JScrollPane sp = new JScrollPane(console);
	sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
	console.setSelectedTextColor(Color.GRAY);
	console.setLineWrap(true);
	console.setWrapStyleWord(true);
	
	// Automatic down scrolling
	DefaultCaret caret = (DefaultCaret) getConsole().getCaret();
	caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
	
	setLayout(new BorderLayout());
	
	add(buttonsPanel, BorderLayout.SOUTH);
	add(sp);
	
	LineBorder lineBorderPanel = (LineBorder) BorderFactory.createLineBorder(PANEL_BORDER_COLOR);
	setBorder(BorderFactory.createTitledBorder(lineBorderPanel, getPanelTitle()));
}
 
開發者ID:tteguayco,項目名稱:JITRAX,代碼行數:37,代碼來源:Console.java

示例13: createLineBorder

import javax.swing.BorderFactory; //導入方法依賴的package包/類
/** Factory method for a line border. */
public final Border createLineBorder() {
    return BorderFactory.createLineBorder(Color.DARK_GRAY);
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:5,代碼來源:ConfigDialog.java

示例14: createTitledBorder

import javax.swing.BorderFactory; //導入方法依賴的package包/類
private void createTitledBorder(String title) {
	LineBorder lineBorderPanel = (LineBorder) BorderFactory.createLineBorder(PANEL_BORDER_COLOR);
	setBorder(BorderFactory.createTitledBorder(lineBorderPanel, title));
}
 
開發者ID:tteguayco,項目名稱:JITRAX,代碼行數:5,代碼來源:Workspace.java


注:本文中的javax.swing.BorderFactory.createLineBorder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。