1
我使用此代碼:的MotifBorders.ButtonBorder unkow默認參數Overrriding方法
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
我要重寫satic內部類的的paintBorder方法ButtonBorder的MotifBorders(的MotifBorders另一個源)並使用它,但我保持方案顏色,我不知道什麼顏色被使用最初由這個LAF(LookAndFeel)。
JButton jb = new JButton(someIcon);
BorderUIResource.CompoundBorderUIResource bc =
(BorderUIResource.CompoundBorderUIResource)jb.getBorder();
MotifBorders.ButtonBorder oldMotifBB =
(MotifBorders.ButtonBorder)bc.getOutsideBorder();
MotifBorders.ButtonBorder newMotifBB = new MotifBorders.ButtonBorder(
shadow,
highlight,
WHAT_ARGUMENT?, /*darkShadow (Originally No defined)*/
focus) {
@Override public void paintBorder(
Component c, Graphics g, int x, int y, int w, int h) {
//Changes Code
}
};