الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

How To Make My Interface Look Better?

مغلق
بدأه java love في 2 ديسمبر 2007 · 2 رد · 714 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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.

#2

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

#3

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

هذا الموضوع مغلق.

مواضيع مشابهة