Questions tagged [jframe]
A JFrame is a component and top-level container of the JFC/Swing framework.
jframe
9,980
questions
1
vote
1
answer
26
views
How do I make this grid display in another jframe?
I have coded a MazeClass that paints a grid and has a method to change the color of a block on the grid. I would like to display this grid in a separate class on a jframe in the position I want to. ...
-1
votes
0
answers
27
views
How do I code a maze in a java class then display it in a jframe form? [duplicate]
I would like to code a maze on Java Netbeans. I am trying to display a 2d array as a maze on a canvas but I have no idea where to start. Do I code the maze in a java class then call it from the jframe?...
0
votes
0
answers
46
views
How to open a new frame when I clicked a button? Is my code a “bad” code? Java GUI Swing
I’m making a frame with numerous buttons inside.
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals("Change Name")){
changeNameGUI.setVisible(true);
...
0
votes
1
answer
20
views
how do i make my g.drawline draw ontop of my JTextFields in a JFrame
i am attempting to make a soduku solving java program. i want it to be graphical and graphical isnt an area ive really explored before.first ive created a graphics method to draw all my needed lines. ...
0
votes
1
answer
34
views
My components in two different panels are too small and don't fit to the frames size, how can I fix this?
I made a JFrame (size: 500 , 600) that uses GridBagLayout to place two JPanels (one using GridLayout and the other using GridBagLayout) on top of each other; however, when I run my JFrame the ...
0
votes
2
answers
54
views
How do I Get JFrame to Display JPanel Text Content Even When Called by Action Event?
I have a simple JFrame dialog, that should display "Please Wait" message while the main program completes other activities (which may take anywhere from 30 seconds to more than 10 minutes):
...
0
votes
0
answers
19
views
Simple animation using a JLabel and ImageIcon throwing an exception
I'm making a simple static animation at the start of my program, and it uses a timer and ImageIcons to work. Here is the code:
int staticChecker = 0;
private void btnStartMouseClicked(java.awt....
0
votes
1
answer
59
views
Is it possible to connect two different JFrames to one single class?
I make two forms but I have this problem where my second form that will appear after we press a button on the first form could not get the data from the subclass. The plan was I want to only use one ...
0
votes
1
answer
51
views
How does JButton call the actionPerformed method?
I was trying to understand exactly how a JButton object works.
I created the below SampleFrame object that extends JFrame.
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
...
1
vote
0
answers
43
views
Starting X and sometimes Y coordinate of JFrame is displaced
Just recently started playing around more with Swing and right now I am trying to build an Algorythm Visualiser. The array being displayed is displaced. The starting X coordinate is shifted to the ...
0
votes
0
answers
29
views
my program still does not recognize txtFechaDev, even though I have the jcalendar 1.4 library
is my first time here, i have a problem in this program, I download the jcalendar 1.4 but the problem is in textFechaDev, it seems that the program txtFechaDev is not declared or there is an error in ...
1
vote
1
answer
70
views
Graphics2d on JPanel
I want to make a program in Java that drops a square at the position of your mouse. For that I wanted to draw a grid as background and then add the squares but as soon as I add a new component to the ...
0
votes
0
answers
49
views
Issue with object arrays and their usage among frames
I need to find a way to handle the object array to send it to the other frame "Start" I've tried various ways but I can't, I'm just a beginner in the field of OOP, I've tried creating ...
1
vote
1
answer
50
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:
...
0
votes
0
answers
35
views
Add image as icon for window
this is the code
import javax.swing.*;
public class test {
public static void main(String[] args) {
System.out.print("Starting up...");
createWindow();
}
private ...