本文整理汇总了Java中javax.swing.border.TitledBorder.setTitleColor方法的典型用法代码示例。如果您正苦于以下问题:Java TitledBorder.setTitleColor方法的具体用法?Java TitledBorder.setTitleColor怎么用?Java TitledBorder.setTitleColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.border.TitledBorder
的用法示例。
在下文中一共展示了TitledBorder.setTitleColor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initComponents
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentsPanel = new JPanel(new BorderLayout());
contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.setOpaque(true);
contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));
headerArea = new HTMLTextArea() {
protected void showURL(URL url) {
String urlString = url.toString();
if (START_LOCATION_URLMASK.equals(urlString)) {
Utils.openLocation(StopwatchProfilingPoint.this.getStartLocation());
} else if (StopwatchProfilingPoint.this.usesEndLocation()) {
Utils.openLocation(StopwatchProfilingPoint.this.getEndLocation());
}
}
};
JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);
dataArea = new HTMLTextArea();
JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
TitledBorder tb = new TitledBorder(Bundle.StopwatchProfilingPoint_DataString());
tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
dataAreaScrollPane.setBorder(tb);
dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);
add(contentsPanel, BorderLayout.CENTER);
}
示例2: initComponents
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentsPanel = new JPanel(new BorderLayout());
contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.setOpaque(true);
contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));
headerArea = new HTMLTextArea() {
protected void showURL(URL url) {
Utils.openLocation(ResetResultsProfilingPoint.this.getLocation());
}
};
JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);
dataArea = new HTMLTextArea();
JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
TitledBorder tb = new TitledBorder(Bundle.ResetResultsProfilingPoint_DataString());
tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
dataAreaScrollPane.setBorder(tb);
dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);
add(contentsPanel, BorderLayout.CENTER);
}
示例3: initComponents
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentsPanel = new JPanel(new BorderLayout());
contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.setOpaque(true);
contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));
headerArea = new HTMLTextArea() {
protected void showURL(URL url) {
String urlString = url.toString();
if (START_LOCATION_URLMASK.equals(urlString)) {
Utils.openLocation(LoadGenProfilingPoint.this.getStartLocation());
} else if (LoadGenProfilingPoint.this.usesEndLocation()) {
Utils.openLocation(LoadGenProfilingPoint.this.getEndLocation());
}
}
};
JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);
dataArea = new HTMLTextArea();
JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
TitledBorder tb = new TitledBorder(Bundle.LoadGenProfilingPoint_DataString());
tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
dataAreaScrollPane.setBorder(tb);
dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);
add(contentsPanel, BorderLayout.CENTER);
}
示例4: disableBorderTitle
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/**
*/
private static void disableBorderTitle(TitledBorder border) {
final Color color = UIManager.getColor(
"Label.disabledForeground"); //NOI18N
if (color != null) {
border.setTitleColor(color);
}
}
示例5: CochleaAMS1cRollingCochleagramADCDisplayMethodGainGUI
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/** Creates new form CochleaAMS1cRollingCochleagramADCDisplayMethodGainGUI */
public CochleaAMS1cRollingCochleagramADCDisplayMethodGainGUI(CochleaAMS1cRollingCochleagramADCDisplayMethod gui, CochleaAMS1cRollingCochleagramADCDisplayMethod.DisplayControl displayControl) {
this.gui = gui;
this.displayControl = displayControl;
initComponents();
gainSp.setValue(getGain());
offsetSp.setValue(getOffset());
hideBut.setSelected(isHidden());
border=new TitledBorder("");
border.setTitleColor(CochleaAMS1cRollingCochleagramADCDisplayMethod.colors[displayControl.getChan()]);
setBorderTitle(displayControl);
setBorder(border);
}
示例6: checkTitleColor
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
/**
* Check behaviour of method TitledBorder.getTitleColor()
*/
private static void checkTitleColor() {
TitledBorder titledBorder = new TitledBorder(new EmptyBorder(1, 1, 1, 1));
Color defaultColor = UIManager.getLookAndFeelDefaults().getColor("TitledBorder.titleColor");
Color titledBorderColor = titledBorder.getTitleColor();
// check default configuration
if (defaultColor == null) {
if (titledBorderColor == null) {
return;
}
else {
throw new RuntimeException("TitledBorder default color should be null");
}
}
if (!defaultColor.equals(titledBorderColor)) {
throw new RuntimeException("L&F default color " + defaultColor.toString()
+ " differs from TitledBorder color " + titledBorderColor.toString());
}
// title color is explicitly specified
Color color = Color.green;
titledBorder.setTitleColor(color);
if (!color.equals(titledBorder.getTitleColor())) {
throw new RuntimeException("TitledBorder color should be " + color.toString());
}
// title color is unspecified
titledBorder.setTitleColor(null);
if (!defaultColor.equals(titledBorder.getTitleColor())) {
throw new RuntimeException("L&F default color " + defaultColor.toString()
+ " differs from TitledBorder color " + titledBorderColor.toString());
}
}
示例7: initComponents
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentsPanel = new JPanel(new BorderLayout());
contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.setOpaque(true);
contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));
headerArea = new HTMLTextArea();
JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);
dataArea = new HTMLTextArea() {
protected void showURL(URL url) {
File resolvedFile = null;
try {
resolvedFile = new File(url.toURI());
} catch (URISyntaxException ex) {
ex.printStackTrace();
}
final File snapshotFile = resolvedFile;
if ((snapshotFile != null) && snapshotFile.exists()) {
String type = TimedTakeSnapshotProfilingPoint.this.getSnapshotType();
if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
ResultsManager.getDefault().openSnapshot(snapshotFile);
}
} else {
ProfilerDialogs.displayWarning(
Bundle.TimedTakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
}
}
};
JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
TitledBorder tb = new TitledBorder(Bundle.TimedTakeSnapshotProfilingPoint_DataString());
tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
dataAreaScrollPane.setBorder(tb);
dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);
add(contentsPanel, BorderLayout.CENTER);
}
示例8: initComponents
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentsPanel = new JPanel(new BorderLayout());
contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.setOpaque(true);
contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));
headerArea = new HTMLTextArea() {
protected void showURL(URL url) {
Utils.openLocation(TakeSnapshotProfilingPoint.this.getLocation());
}
};
JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);
dataArea = new HTMLTextArea() {
protected void showURL(URL url) {
File resolvedFile = null;
try {
resolvedFile = new File(url.toURI());
} catch (URISyntaxException ex) {
ex.printStackTrace();
}
final File snapshotFile = resolvedFile;
if ((snapshotFile != null) && snapshotFile.exists()) {
String type = TakeSnapshotProfilingPoint.this.getSnapshotType();
if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
ResultsManager.getDefault().openSnapshot(snapshotFile);
}
} else {
ProfilerDialogs.displayWarning(
Bundle.TakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
}
}
};
JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
TitledBorder tb = new TitledBorder(Bundle.TakeSnapshotProfilingPoint_DataString());
tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
dataAreaScrollPane.setBorder(tb);
dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);
add(contentsPanel, BorderLayout.CENTER);
}
示例9: initComponents
import javax.swing.border.TitledBorder; //导入方法依赖的package包/类
private void initComponents() {
setLayout(new BorderLayout());
JPanel contentsPanel = new JPanel(new BorderLayout());
contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.setOpaque(true);
contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));
headerArea = new HTMLTextArea();
JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);
dataArea = new HTMLTextArea() {
protected void showURL(URL url) {
File resolvedFile = null;
try {
resolvedFile = new File(url.toURI());
} catch (URISyntaxException ex) {
ex.printStackTrace();
}
final File snapshotFile = resolvedFile;
if ((snapshotFile != null) && snapshotFile.exists()) {
String type = TriggeredTakeSnapshotProfilingPoint.this.getSnapshotType();
if (type.equals(TYPE_PROFDATA_KEY) || type.equals(TYPE_HEAPDUMP_KEY)) {
ResultsManager.getDefault().openSnapshot(snapshotFile);
}
} else {
ProfilerDialogs.displayWarning(
Bundle.TriggeredTakeSnapshotProfilingPoint_SnapshotNotAvailableMsg());
}
}
};
JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
TitledBorder tb = new TitledBorder(Bundle.TriggeredTakeSnapshotProfilingPoint_DataString());
tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
dataAreaScrollPane.setBorder(tb);
dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);
add(contentsPanel, BorderLayout.CENTER);
}