java选项卡“绘制选定对象”选项卡
我想以不同于其他选项卡的方式绘制所选选项卡,它第一次可以工作,但是重新绘制不起作用
以下是我在paintTabBackground中执行的代码:
Graphics2D g2d = (Graphics2D) g.create();
if (isSelected) {
BufferedImage background = tabSelected;
Insets insets = getTabInsets(tabPlacement, tabIndex);
Rectangle tabBound = getTabBounds(tabPane, tabIndex);
tileStretchPaint(g2d, tabBound, background, insets);
} else {
g2d.setColor(new Color(0, 0, 0, 0));
super.paintTabBackground(g2d, tabPlacement, tabIndex, x, y, w, h, isSelected);
}
g2d.dispose();
谢谢你的帮助
共 (0) 个答案