本文整理汇总了Java中javax.swing.BorderFactory.createMatteBorder方法的典型用法代码示例。如果您正苦于以下问题:Java BorderFactory.createMatteBorder方法的具体用法?Java BorderFactory.createMatteBorder怎么用?Java BorderFactory.createMatteBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.BorderFactory
的用法示例。
在下文中一共展示了BorderFactory.createMatteBorder方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initComponents2
import javax.swing.BorderFactory; //导入方法依赖的package包/类
private void initComponents2() {
header = new HeaderPanel();
title = header.getTitle();
button = header.getButton();
button2 = header.getButton2();
Border outsideBorder = BorderFactory.createMatteBorder(0, 0, 1, 0, Color.gray);
Border insideBorder = BorderFactory.createEmptyBorder(3, 3, 3, 3);
CompoundBorder compoundBorder = BorderFactory.createCompoundBorder(outsideBorder, insideBorder);
header.setBorder(compoundBorder);
button.setVisible(false);
button2.setVisible(false);
rightCornerHeader = new JPanel();
rightCornerHeader.setBorder(compoundBorder);
Color headerBgColor = UnitTable.getDarkerColor(getBackground());
header.setBackground(headerBgColor);
if (button != null) {
button.setOpaque(false);
}
if (button2 != null) {
button2.setOpaque(false);
}
rightCornerHeader.setBackground(headerBgColor);
setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 0));
}
示例2: getTableCellRendererComponent
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row, int column) {
Color newColor = (Color)color;
setBackground(newColor);
if (isBordered) {
if (isSelected) {
if (selectedBorder == null) {
selectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getSelectionBackground());
}
setBorder(selectedBorder);
} else {
if (unselectedBorder == null) {
unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getBackground());
}
setBorder(unselectedBorder);
}
}
if(newColor!=null){
setToolTipText("RGB value: " + newColor.getRed() + ", " + newColor.getGreen() + ", " + newColor.getBlue());
}
return this;
}
示例3: getTableCellRendererComponent
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Returns TableCellRendererComponent used to show a rectangle of the right color in the table
*/
public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row, int column) {
Color newColor = (Color) color;
label.setBackground(newColor);
if (isSelected) {
if (selectedBorder == null) {
selectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getSelectionBackground());
}
label.setBorder(selectedBorder);
} else {
if (unselectedBorder == null) {
unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getBackground());
}
label.setBorder(unselectedBorder);
}
return label;
}
示例4: getTableCellRendererComponent
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row,
int column) {
Color newColor = (Color) color;
setBackground(newColor);
if (isBordered) {
if (isSelected) {
if (selectedBorder == null) {
selectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getSelectionBackground());
}
setBorder(selectedBorder);
} else {
if (unselectedBorder == null) {
unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getBackground());
}
setBorder(unselectedBorder);
}
}
setToolTipText("RGB value: " + newColor.getRed() + ", " + newColor.getGreen() + ", " + newColor.getBlue());
return this;
}
示例5: getTableCellRendererComponent
import javax.swing.BorderFactory; //导入方法依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value == null) {
return this;
}
Color color = (Color) value;
setBackground(color);
if (isBordered) {
if (isSelected) {
if (selectedBorder == null) {
selectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getSelectionBackground());
}
setBorder(selectedBorder);
} else {
if (unselectedBorder == null) {
unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getBackground());
}
setBorder(unselectedBorder);
}
}
setToolTipText("RGB (" + color.getRed() + ", " + color.getGreen() + ", " + color.getBlue() + ")");
return this;
}
示例6: updateProblem
import javax.swing.BorderFactory; //导入方法依赖的package包/类
void updateProblem()
{
String prob = wizard.getProblem();
problem.setText(prob == null ? " " : prob); // NOI18N
if (prob != null && prob.trim().length() == 0)
{
// Issue 3 - provide ability to disable next w/o
// showing the error line
prob = null;
}
Border b = prob == null ? BorderFactory.createEmptyBorder(1, 0, 0, 0) : BorderFactory
.createMatteBorder(1, 0, 0, 0, problem.getForeground());
Border b1 = BorderFactory.createCompoundBorder(BorderFactory
.createEmptyBorder(0, 12, 0, 12), b);
problem.setBorder(b1);
}
示例7: setProfilingPointFactory
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public void setProfilingPointFactory(ProfilingPointFactory ppFactory, int index) {
this.ppFactory = ppFactory;
if (ppFactory != null) {
label.setText(ppFactory.getType());
label.setIcon(ppFactory.getIcon());
} else {
label.setText(NO_ACTION_NAME);
label.setIcon(NO_ACTION_ICON);
}
Component selected = null;
if ((index >= 0) && (index < previewPanel.getComponentCount())) {
selected = previewPanel.getComponent(index);
}
for (Component c : previewPanel.getComponents()) {
if (c == selected) {
Border empt1 = BorderFactory.createEmptyBorder(2, 2, 2, 2);
Border sel = BorderFactory.createMatteBorder(1, 1, 1, 1, SystemColor.textHighlight);
Border empt2 = BorderFactory.createEmptyBorder(0, 2, 0, 2);
Border comp1 = BorderFactory.createCompoundBorder(empt2, sel);
Border comp2 = BorderFactory.createCompoundBorder(comp1, empt1);
((JComponent) c).setBorder(comp2);
} else {
((JComponent) c).setBorder(BorderFactory.createEmptyBorder(3, 5, 3, 5));
}
}
}
示例8: createTabBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
static Border createTabBorder( JTable table, int tabsLocation ) {
if( IS_AQUA ) {
return BorderFactory.createMatteBorder( 1, 0, 0, 0, table.getGridColor());
} else {
if( tabsLocation != JTabbedPane.TOP )
return BorderFactory.createMatteBorder( 1, 0, 0, 0, table.getGridColor());
}
return BorderFactory.createEmptyBorder();
}
示例9: createInstanceImpl
import javax.swing.BorderFactory; //导入方法依赖的package包/类
protected Border createInstanceImpl() {
Insets i = insets.createInstance();
if (color == null) {
return BorderFactory.createMatteBorder(i.top, i.left, i.bottom,
i.right, tileIcon == null ? null : tileIcon.createInstance());
} else {
return BorderFactory.createMatteBorder(i.top, i.left, i.bottom,
i.right, color.createInstance());
}
}
示例10: createBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public static Border createBorder() {
return BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY);
}