473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 1134
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeroni Paul | last post by:
<BODY onmousemove="return false;" oncontextmenu="return false;"> <IMG src="button.gif" onmouseover="this.src='down.gif'" onmouseout="this.src='button.gif'"> </BODY> This simple example shows...
2
by: Ester | last post by:
Instead of drag and drop image button from Toolbox and name the image button id on the properties box, I would like to load image button ID from database. I created a database table that stores...
12
by: BC | last post by:
Hello, We are creating an Office add-in. We are able to display the add-in successfully. However, we followed a sample program, and it displays a FaceID = 1044 (which is not the bitmap of the...
21
by: MLH | last post by:
If I choose a command button on a form in design view, open the properties box and click the Picture property and its wiz button, I'm presented with a lengthy list of pictures. Everything from Add...
1
by: AA Arens | last post by:
How to change the color of the buttons or the button from the switchboard? I use Access2003 but the database is from <2003, so the buttons are gray and squaired. Bart
0
by: jcvoon | last post by:
Hi: I'm using VS2005, I add my image into project resource file, and my picture box and button control reference the image from the project resource file, what is the default transparent color...
0
by: Zielinski | last post by:
Hi, Recently I started to use matplotlib with python. Now I would like to have interaction with my plots. Here is the problem: I have a long vector of data, to long to display it on one...
11
NeoPa
by: NeoPa | last post by:
What needs to be set and/or changed when switching the Picture property of a Command Button within VBA code? The scenario is that I have a continuous form for a particular table. The controls (in...
4
by: remya1000 | last post by:
i'm using VB.Net Application program. i'm creating 64 button dynamically during run time. and from database i'm getting the description, font color, back color and picture path. and if the picture...
3
by: draxaman | last post by:
i have created a button using rectangle and now i want to add a picture that will be shown on the button. Where do i add the picture, or what command do i use to fill the rect with the pic?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.