📄 e837. setting the color of a tab in a jtabbedpane container.txt
字号:
// Create a tabbed pane
JTabbedPane pane = new JTabbedPane();
// Set the text color for all tabs
pane.setForeground(Color.YELLOW);
// Set the background color for all tabs
pane.setBackground(Color.MAGENTA);
// Add a tab
String label = "Tab Label";
pane.addTab(label, component);
// Get index of the new tab
int index = pane.getTabCount()-1;
// Set text color for the new tab
pane.setForegroundAt(index, Color.ORANGE);
// Set background color for the new tab
pane.setBackgroundAt(index, Color.GREEN);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -