Chameleon <cham_gss@hotmail.NOSPAM.com> wrote in news:djk00u$a5e$1
@volcano1.grnet.gr:
> http://www.cs.cf.ac.uk/Dave/HCI/HCI_Handout_CALLER/menu.gif
>
[quoted text clipped - 8 lines]
>
> Start in y axis of "O" from "Open"?
Easiest would be to have a transparent gif image the same size of the other
icons and use that for the JMenuItems that don't have an icon.
I think you can do the same by using Swing "padding" classes such as
HorizontalGlue. I'm not sure though. And even if it is possible, I don't
recommend it. It'll be a lot of code for what can be done with one or two
lines if you just add a transparent gif image.
Thomas Fritsch - 25 Oct 2005 02:36 GMT
> Easiest would be to have a transparent gif image the same size of the
> other
> icons and use that for the JMenuItems that don't have an icon.
As an alternative you can create a transparent icon with the following
class:
public class BlankIcon implements Icon {
public int getIconHeight() { return 24; }
public int getIconWidth() { return 24; }
public void paintIcon(Component c, Graphics g, int x, int y) {
/*nothing*/ }
}

Signature
"TFritsch$t-online:de".replace(':','.').replace('$','@')
zero - 26 Oct 2005 22:50 GMT
"Thomas Fritsch" <i.dont.like.spam@invalid.com> wrote in news:djk222$mlg$03
$1@news.t-online.com:
> As an alternative you can create a transparent icon with the following
> class:
[quoted text clipped - 5 lines]
> /*nothing*/ }
> }
Interesting idea. Have you tested this with both opaque and non-opaque
components?
Thomas Fritsch - 27 Oct 2005 00:20 GMT
> Interesting idea. Have you tested this with both opaque and non-opaque
> components?
Until now only with JMenuItem.
On Tue, 25 Oct 2005 03:59:13 +0300, Chameleon
<cham_gss@hotmail.NOSPAM.com> wrote, quoted or indirectly quoted
someone who said :
>In this picture we see a JMenu with images.
>
[quoted text clipped - 6 lines]
>
>Start in y axis of "O" from "Open"?
You are just asking how to set up a JMenu?
See http://mindprod.com/jgloss/jmenu.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.