imageicon Questions
5
Solved
An ImageIcon is added to button properties using NetBeans.
print.setFont(new java.awt.Font("Serif", 0, 14));
print.setIcon(new javax.swing.ImageIcon(getClass().getResource("/project/print.gif")...
5
Solved
I am trying to set an icon to a JLabel from a folder of images whenever an item is selected from a JComboBox. The name of items in the JComboBox and name of the images in the folder are same. So wh...
6
Solved
I'm trying to set the icon image for a Jar file:
setIconImage(new ImageIcon(getClass().getResource("logo.png")).getImage());
When running in Mac OS X 10.7.4 I get the following error:
Jun 28 15...
2
Solved
I am using bottomNavigationBar in my flutter project I'm new in flutter and have I no idea about pagination and use assets image icons instead of iconData. I searched about it for the last 2 days b...
Bresnahan asked 4/6, 2019 at 6:44
6
Solved
5
Solved
I have an Image object that I would like to convert to an Icon or ImageIcon to add to a JTextPane. How would I go about doing this?
(this is in JAVA)
clarification: my "Image" is an instance of t...
3
Solved
Does anyone know how to set a C# console application's icon in the code (not using project properties in Visual Studio)?
Lot asked 23/7, 2009 at 8:18
2
// my code that calls upon n images in a directory to be placed on the JPanel
public void imageAdder(int n, String name){
BufferedImage myPic = null;
for (int i = 0; i <= n; i++){
try {
my...
Cecillececily asked 13/1, 2015 at 5:5
5
Solved
I got the animation to work in my Snake Clone Game. But the problem based on the picture is that the images do not have transparency(notice the white background of the circle pictures. Programming-...
Ruiz asked 31/12, 2012 at 4:20
3
Java JLabel icons are displaying with distorted pixels in JFrame. This is happening consistently with different png images (all 32x32). I am not scaling the images, they are displayed in the progra...
3
How to remove icon from JOptionPane?
ImageIcon icon = new ImageIcon(image);
JLabel label = new JLabel(icon);
int result = JOptionPane.showConfirmDialog((Component) null, label, "ScreenPreview", JO...
Jestude asked 7/6, 2013 at 10:21
4
Solved
My Question: I want to be able to change the brightness of a resource image and have three instances of it as ImageIcons. One at 50% brightness (so darker), another at 75% brightness (a little brig...
Challenging asked 19/10, 2012 at 19:2
4
I need to write text in the center of an image. The text to write is not always the same.
The code I'm using is here:
// Here I first draw the image
g.drawImage(img, 22, 15, 280, 225, null);
// I...
Careycarfare asked 6/9, 2011 at 17:6
5
Solved
Ok so I've been researching this one quiet a bit. I am fairly new to java but thought that this one would be easy. Ive tried just about every way that has been answered on this site and still no lu...
11
I am following the Snake Java games tutorial and always get this error:
ImageIcon iid = new ImageIcon(this.getClass().getResource("ball.png"));
ball = iid.getImage();
Exception in thread...
Jackquelinejackrabbit asked 24/4, 2011 at 7:48
5
Solved
When running a Java app from eclipse my ImageIcon shows up just fine.
But after creating a jar the path to the image obviously gets screwed up.
Is there a way to extract an image from the jar at ...
Wasteful asked 27/8, 2008 at 20:14
7
On my JFrame, I am using the following code to display an image on the Panel :
ImageIcon img= new ImageIcon("res.png");
jLabel.setIcon(img);
I would like to "auto-size" the picture in the labe...
3
I'm following this tutorial for java swing games: http://zetcode.com/tutorials/javagamestutorial/movingsprites/
At this point:
ImageIcon ii = new ImageIcon(this.getClass().getResource());
image =...
Suzan asked 28/7, 2013 at 19:35
6
I wanted to test having a program with a simple png image on it. I wrote a short program that does this, but I can't seem to get the path right. I have checked, checked again, rechecked, and quadru...
Viviennevivify asked 19/5, 2013 at 5:8
5
Solved
3
Solved
I'm trying to add an image to one frame but it seems it does not working. The image created by an ImageIcon from the specified file. The image file is in the seam directory the java file exist.
im...
3
Solved
1
Solved
I'm trying to animate a GIF image. The animation works, but it's not painting well.
It shows like this (non-animated screenshot):
In the image, the tail wags like this:
As you can see, the ima...
1
Solved
Hi i have created a j list and there i want to add an image before any text in that text how can i do this i tried but i am not able to achieve my goal i want to add an image before list element"Ba...
2
Solved
I am trying to load multiple images on the same window, so to prevent a lot of copy and paste, I made an image class called badgeIMG that looks like this:
package BattleSim;
import java.awt.Graph...
Ninepins asked 2/1, 2014 at 16:43
1 Next >
© 2022 - 2024 — McMap. All rights reserved.