当前位置: 首页>>代码示例>>Java>>正文


Java BorderFactory.createMatteBorder方法代码示例

本文整理汇总了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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:DetailsPanel.java

示例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;
    }
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:24,代码来源:TableCellRenderer4Color.java

示例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;
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:20,代码来源:ColorCellEditor.java

示例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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:22,代码来源:ColorRenderer.java

示例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;
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:27,代码来源:ColorCellRenderer.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:19,代码来源:WizardDisplayerImpl.java

示例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));
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:ToggleProfilingPointAction.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:TabTableUI.java

示例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());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:BorderBuilders.java

示例10: createBorder

import javax.swing.BorderFactory; //导入方法依赖的package包/类
public static Border createBorder() {
	return BorderFactory.createMatteBorder(1, 1, 1, 1, Color.LIGHT_GRAY);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:ButtonDialog.java


注:本文中的javax.swing.BorderFactory.createMatteBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。