本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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());
}
示例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);
}
}
}
示例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());
}
示例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.)
}
示例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);
}
示例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"));
}
示例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;
}
示例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();
}
示例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()));
}
示例13: createLineBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/** Factory method for a line border. */
public final Border createLineBorder() {
return BorderFactory.createLineBorder(Color.DARK_GRAY);
}
示例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));
}