Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

[skinlf-dev] Bug correction

Sent on:Fri, 22 Dec 2006 12:37:11 +0100 (CET)

I recently used skinlf to provide a better look to my
Unfortunately i got troubles with the menu items.
so i corrected some little things.
it's working but not for everything, especially with
transparent skins like whistler.

Here is the code fragment:


public boolean paintMenuItem(java.awt.Graphics g,
javax.swing.JMenuItem c) {
if (menuitemSelected != null) {
// FIXME: bug correction or skin
if (c.isArmed() || (c instanceof JMenu &&
c.getModel().isSelected())) {
if(c.isOpaque()) {
paintOpaqueMenuItem( g, c );
} else {
menuitemSelected.paint(g, c);
} else
if( c.isOpaque() ) {
paintOpaqueMenuItem( g, c );
else {
return false;

return true;
else {
return false;

private void paintOpaqueMenuItem( java.awt.Graphics
g, javax.swing.JMenuItem c ) {
if( background != null ) {
ImageUtils.paint(c, g, background,
} else {
Rectangle rect = c.getVisibleRect();
Color old = g.getColor();
g.setColor( c.getBackground() );

// for the whistler theme pack
Composite oldComposite = ((Graphics2D)

g.fillRect( rect.x, rect.y, rect.width,
rect.height );
g.setColor( old );
((Graphics2D) g).setComposite(oldComposite);

I would like to get your comments about this stuff.
And if it's working, maybe you can include it in a
next release :)

Oh by the way, i post you from a tricky address,
please follow-up to fredREMOVEisfree AT users .
sourceforge .net

Happy Christmas!

Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.

To unsubscribe, e-mail: [dev-unsubscribe@masked-domain]
For additional commands, e-mail: [dev-help@masked-domain]
Found what you were looking for? If not - continue at Wiki Index

Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources

Sedo - Buy and Sell Domain Names and Websites project info: Statistics for project etracker� web controlling instead of log file analysis