1,041 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
59
views
Displaying GIF files in a Java GridLayout - Blank Output
I'm trying to write a program that uses Java's GridLayout to display a 2x2 set of GIFs. It runs without any errors but the output window I get is blank. The same code works to display a text label or ...
0
votes
1
answer
68
views
Add ImageIcon + text to JLabel
I would like to add an image and some text to the cell of a JTable.
Here is the GUI class that seems to cause problems:
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax....
0
votes
0
answers
88
views
Swing JFrame Icons Not Loading When Called from Another Class (Please ignore my naming conventions xD) (Netbeans, openjdk 20.0.2 64-bit)
I am working on a Java project for a school-related Task, and I'm experiencing an issue when it comes to loading icon images onto JButtons.
So, to start, when I run my JFrame Form directly in the file,...
1
vote
1
answer
71
views
Image URL syntax
I am trying to make a background image in a java jframe window, but when I try to initialize it, I get a null pointer exception saying the location url I put in is null.
I've tried the following:
...
1
vote
1
answer
124
views
Why does my ImageIcon disappear after using setLocation() on JFrame?
I want to move a JFrame window containing a GIF across my screen, but when I try the following:
icon = new ImageIcon(spritePath);
frame.add(new JLabel(icon));
frame.setSize(icon.getIconWidth(), icon....
-1
votes
2
answers
118
views
I can't get the ImageIcon to display properly
Everything works except when I push run, it doesn't show the icon for the label in the JFrame. Does anyone know how to fix that?
public class Frame extends JFrame
{
private final int speed=5;
...
0
votes
1
answer
73
views
images cannot be displayed in the bare menu but not in the rest of the grid
I have the following wpf grid block. I have an image named truc.PNG, a small file image measuring 16x16 pixels. I can see it in the image block, but not as an icon in one of the menu bar items.I've ...
0
votes
0
answers
58
views
Java ImageIcon Low Definition Display
In java, why is it that when I import an image and convert it to ImageIcon and display it using JLabel or JButton, it results to a low definition image where I can see the pixels at the edges of my ...
0
votes
0
answers
38
views
How could I add and image to a JLabel, when the image is in a parent directory in Java?
Using java
Lets pretend we are in folder "src". The parent directory contains folders "src", "assets" and "bin".
Since I am in the folder "src", how ...
0
votes
1
answer
37
views
How to put text next to my ImageIcon on a cell in a JTable [duplicate]
I have an application that works with a JTable, and in this JTable, I want each cell to have both an ImageIcon and some text.
I see at this link (https://docs.oracle.com/javase/tutorial/uiswing/...
0
votes
0
answers
56
views
Image Icon won't appear
I am trying to add an Image Icon to my game so a logo appears when it is in the task bar. I get no errors when I run my code but the image won't appear.
public class Game implements Runnable {
...
-1
votes
1
answer
39
views
Reading images imported into NetBeans
I have imported images into my NetBeans project:
I'm trying to read the image path and want to display them on JLabels using the scaleImage() method.
My code:
public Home() {
initComponents();
...
0
votes
0
answers
43
views
Why are my JButtons not transparent after using the setOpaque() function?
I've set my JButtons to be transparent and I added pictures with transparent background to them, but they refuse to become transparent. Moreover, it works on Windows but does not work on my MacBook.
I ...
1
vote
0
answers
23
views
Java ImageIcon trying to set up
public class MyPanel extends JPanel implements ActionListener {
final int PANEL_WIDTH = 500;
final int PANEL_HEIGHT = 500;
Image BackGroundImage2;
Image BackGroundImage;
...
-2
votes
1
answer
76
views
How to move a imageIcon on the left side of JPanel?
I'm trying to move ImageIcon torrentIcon to the left side of JPanel jp, because it's located in the center of panel near the JLabel jl. Neither setBounds() nor setHorizontalTextPosition(), ...