I would like to know if it's possible to set an image as background for a jmenubar+jtoolbar (not only for one of theym, not one for each of theym But on for BOTH) ...
Anyone's got an idea ?? How should I do that if it's possible ?
Thanks !
Here an image to explain :
Solved :: I used two images (cutted to the right size to suite my jmenubar+jtoolbar) and added these to the object's declarations as overrides and it works great ! Here is a piece of code :
///////////////////////////////
JToolBar toolBar = new JToolBar(){
@Override
protected void paintComponent(Graphics g){
Image photo = getToolkit().getImage("src/MainFrame/Images/xtremeCalliBottom.png");
super.paintComponent(g) ;
int x=(mainFrame.getWidth()-200), y=0 ;
if(photo != null)
g.drawImage (photo, x, y, this);
}
};
// ............
//========== Menu Bar
jMenuBar = new JMenuBar(){
@Override
protected void paintComponent(Graphics g){
Image photo = getToolkit().getImage("src/MainFrame/Images/xtremeCalliTop.png");
super.paintComponent(g) ;
int x=(mainFrame.getWidth()-200), y=0 ;
if(photo != null)
g.drawImage (photo, x, y, this);
}
};
// ................
jMenuBar.setPreferredSize(new Dimension(100, 25));
toolBar.setPreferredSize(new Dimension(100,40));