Skip to main content

setIcon() for JXErrorDialog (patch)

No replies
andrew_moiseenko
Offline
Joined: 2005-05-25

Hello, I'm using JXErrorDialog in my project, and I want to show it with different icons (other then default OptionPane.warningIcon"), so I've implemented this by adding setters and getters for icon field.

This is the patch:

Index: JXErrorDialog.java
===================================================================
RCS file: /cvs/swingx/src/java/org/jdesktop/swingx/JXErrorDialog.java,v
retrieving revision 1.15
diff -c -r1.15 JXErrorDialog.java
*** JXErrorDialog.java 21 Jan 2006 23:41:54 -0000 1.15
--- JXErrorDialog.java 17 Feb 2006 16:20:15 -0000
***************
*** 89,95 ****
/**
* Icon for the error dialog (stop sign, etc)
*/
! private static final Icon icon = UIManager.getIcon("OptionPane.warningIcon");
/**
* Error message text area
*/
--- 89,95 ----
/**
* Icon for the error dialog (stop sign, etc)
*/
! private static Icon icon = UIManager.getIcon("OptionPane.warningIcon");
/**
* Error message text area
*/
***************
*** 561,564 ****
--- 561,572 ----
}

}
+
+ public static Icon getIcon() {
+ return icon;
+ }
+
+ public static void setIcon(Icon icon) {
+ JXErrorDialog.icon = icon;
+ }
}