I am using eclipse with jiglo plug-in
I want to make my interface look nice , I mean the background
I don't want the normal color,I want to put picture for example.
I am using eclipse with jiglo plug-in
I want to make my interface look nice , I mean the background
I don't want the normal color,I want to put picture for example.
you have to override the "paint" method in your JFrame class
public void paint(Graphics g)
{
super.paint(g);
ImageIcon image = new ImageIcon(path);
g.draw(image, 0,0,this.getWidth(), this.getHeight(),this);
}good luck
SCJP 5.0
And about g.draw();
there is no draw method .. there is drawline..drawArc..drawImage
mayebe u mean drawimage method.
public NewJFrame() {
super();
initGUI();
}
}
private void initGUI() {
try {
GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
getContentPane().setLayout(thisLayout);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setIconImage(new ImageIcon(getClass().getClassLoader().getResource("baby-5.jpg")).getImage());
{
jMenuBar1 = new JMenuBar();
setJMenuBar(jMenuBar1);
jMenuBar1.add(getJMenu1());
jMenuBar1.add(getHelp());
}
My code look like this ...
Thanks alot for ur helpتم تعديل هذه المشاركة بواسطة java love في 3 ديسمبر 2007 في 11:10
هذا الموضوع مغلق.