471,119 Members | 1,410 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

A button with a picture

The picture will not appear, but why??????????
When I use a simple applet, it works.

-------------------------------------------------------------------------------------------------------------------------
package test;

public class TestClass
{

public TestClass()
{
}

public static void main(String[] args)
{
TestClass testClass = new TestClass();
TestFrame test = new TestFrame();
test.show();
}

}
-----------------------------------------------------------------------------------------------------------------------------

package test;

import java.awt.*;
import javax.swing.*;

public class TestFrame extends JFrame
{
JButton jButton1 = new JButton();

public TestFrame()
{
try
{
jbInit();
}
catch(Exception e)
{
e.printStackTrace();
}
}

private void jbInit() throws Exception
{
jButton1.setText("jButton1");
jButton1.setBounds(new Rectangle(67, 37, 182, 114));
this.getContentPane().setLayout(null);
this.setSize(new Dimension(300, 300));
this.getContentPane().add(jButton1, null);
}

// ????????????????????????????
// ????????????????????????????
// ????????????????????????????
private void picture()
{
ImageIcon pic = new ImageIcon("images/duke.gif");
jButton1.setIcon(pic);
}

}

Jul 23 '05 #1
2 1088
On Thu, 30 Dec 2004 15:05:03 +0100, H. Sommers wrote:
The picture will not appear, but why??????????


Whereas this friggin' post will pop up all across the groups. Sheeshh!

The answers to your question are provided on *one* of the many threads
you bombarded the Java groups with. No go and find it and stop bothering
the JS group, your question is in no way relevant to this group.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #2
In article <f6*************************@news1.zonnet.nl>,
H.*******@freeler.nl says...
The picture will not appear, but why??????????


JavaScript != Java. Once you've figured that out you'll be well on your
way to fixing the problem.

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jeroni Paul | last post: by
reply views Thread by Zielinski | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.