472,782 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 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 1122
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?
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.