Hi Guy's !!! How can a JToolBar instance in appearance be made to look similar to "Windows" toolbar(one used in Internet Explorer,Windows Explorer,MS-Office).It appears flat on-sight but elevated on "MouseOver" and appears depressed on "Click". Pls Suggest. Thanks a lot.
Hi! The way I have done this is when I create the button, i set border painted to false like so: mybutton.setBorderPainted(false); Then, I use a mouseListener as Daniel suggests (I extend mouseListener on the encompassing JFrame or JToolBar class, and then define the methods mouseExited() mouseEntered(). Then, when the event source is mybutton, do this in mouseEntered()... mybutton.setBorderPainted(true); and this in mouseExited... mybutton.setBorderPainted(false);
Seems to work ok when I have done this a couple of times in different apps. Haven't done the depressed look 'on click' because it doesn't seem worth the bother to me cheers, Ben.