Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
75 views

A few days ago, I encountered a Swing error when trying to change the transparency of the JFrame (undecorated), which lost its color and transparency information (instead of displaying the selected ...
Marce Puente's user avatar
  • 1,239
0 votes
2 answers
99 views

I made a Java program with Swing libraries that displays text and an image. Both the text string and the image filename are set via a set method, but while the text is displayed correctly, the image ...
Fabio Ferro's user avatar
0 votes
0 answers
24 views

I'm working on a basic Hidden object game for fun. Im not a professional coder by any means. At the main menu of the game (where you select start game, exit, resume, or how to play) I have 4 Jbuttons ...
mharner's user avatar
1 vote
1 answer
69 views

I'm trying to create a class which represents a playing card as a JPanel, (which I add to a window in another class), but I don't know how to make the panel stay at a specific size when I add it to ...
Bluebox's user avatar
  • 13
2 votes
1 answer
81 views

I’m building a simple Java Swing UI and want a thin red header bar at the top with just a title label (“Unit Converter”). However, the JPanel takes up too much vertical space. I only want a slim ...
jamesdiaz's user avatar
  • 137
0 votes
1 answer
176 views

I was building a calculator project and I am new to JAVA & stackOverflow. So far build the entire thing except the titlebar which is default. As titlebar is controlled by OS we can't make direct ...
Ashwin V's user avatar
0 votes
1 answer
85 views

I've been trying to create a program that tracks a shopping list and adds new JLabels whenever the corresponding buttons are pressed, but for some reason whenever I press the button nothing new comes ...
Rage Lord's user avatar
0 votes
0 answers
82 views

I've been coding a project in Netbeans on Java, and it makes use of a series of JFrames for login screens, main menus etc. I was coding it yesterday and was working just as expected, with everything ...
Daniel Teeling-Smith's user avatar
0 votes
0 answers
60 views

I’m trying to display two buttons (“Increase” and “Decrease”) in one panel and a label (“Points:”) in another that should be located under Panel1. But when I run the program, only Panel2 with the ...
jamesdiaz's user avatar
  • 137
-1 votes
1 answer
76 views

I'm learning Java Swing and wanted to make sure I understand the common approach to building GUIs. As far as I understand, the typical workflow is: Create a JFrame as the main window. Add one or more ...
jamesdiaz's user avatar
  • 137
0 votes
2 answers
90 views

I’m an absolute beginner with Java Swing and trying to build a simple GUI for a unit converter. In the following code, I add a JButton directly to the JFrame using BorderLayout.PAGE_END. The button ...
jamesdiaz's user avatar
  • 137
-1 votes
3 answers
134 views

I’m working on a Java Swing application and would like to place a button so that it is horizontally centered and vertically positioned near the bottom of the window — similar to how a typical “Submit” ...
jamesdiaz's user avatar
  • 137
0 votes
1 answer
36 views

I'm writing code for a fairly simple GUI, but I'm having some trouble getting my buttons to be functional. Working on Eclipse IDE. I have my frame, and all items I wish to add to it (i.e. buttons, ...
RRS's user avatar
  • 23
0 votes
1 answer
109 views

I'm currently making an inventory display menu to manage tools around the shop easier. MainMenu (JFrame Form) I want to make a GUI that populates a JPanel in a JScrollPane with a premade JPanel Form ...
Victor Euan Jr's user avatar
1 vote
1 answer
79 views

I've had a few suggestions on SO regarding Full Screen for a Java app, and the most-offered suggestion is to simply create a second JFrame into which the app's main content can be moved. In theory, ...
Willicious's user avatar
0 votes
1 answer
47 views

The panel is showing up blank and even when I setContentPane(null), the words on the panel wont show up how I want them to with set Bounds. I tried changing the order of my configurations for the ...
Aejt's user avatar
  • 11
1 vote
1 answer
102 views

I am trying to make a frame with a label, (I have created a separate class for the frame), but idk why the label isn´t showing in the frame... import java.awt.Color; import javax.swing.ImageIcon; ...
silent storm's user avatar
0 votes
1 answer
35 views

I have a JFrame with a JPanel inside. MyFrame class: public class MyFrame extends JFrame { private JPanel contentPane; public static void main(String[] args) { new MyFrame()....
Renan Machado's user avatar
0 votes
1 answer
70 views

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....
Nocxy's user avatar
  • 181
0 votes
0 answers
150 views

I need that my readString method be blocking until user input his text into the TextArea. This is a model of my problem: public class Consola { private final JDialog dialog; private final ...
user3216993's user avatar
0 votes
0 answers
71 views

I am trying to make a small games with a native resolution of 320x180, then scale it up for a bigger window. but I'm getting transparent lines in my sprites. right now I'm drawing to a BufferedImage ...
ben carvalho's user avatar
0 votes
2 answers
75 views

I am very new to Java, and am trying to make a program that asks to use to guess a random number between 1 and 77. How can I make the while loop in this code run only when an answer has been provided ...
Michael Carpiano's user avatar
1 vote
2 answers
116 views

I have a JDialog (non modal) with a JFrame owner. The problem I have is the that when the JDialog has the focus it is preventing the ActionListener associated with the JFrame JMenuItem accelerators ...
Ian's user avatar
  • 11
0 votes
1 answer
65 views

I am working with a JPopupMenu in Java Swing and need to allow users to navigate through the menu using the up/down arrow keys. However, I am setting the JPopupMenu to be non-focusable (popupMenu....
Rafi Ahmed's user avatar
0 votes
1 answer
68 views

I have WebSocket server: @ServerEndpoint(value = "/demoApp") public class MyWebSocketServer { @OnMessage public String onMessage (String message, Session session) throws IOException {...
Okneas's user avatar
  • 21
-3 votes
2 answers
111 views

I have tried to get a textbox to display an array, but as far as I have tried it only shows the last number of the array ex: array gives: 1, 24, 18, 98, 100, 78, 63, 24, 77, 46 Textbox displays: 46 ...
Brandon Blank's user avatar
1 vote
2 answers
79 views

import javax.swing.*; import java.awt.event.*; public class Test { private String textFieldValue; public Test() { JFrame frame = new JFrame (); JPanel panel = new ...
G Yu's user avatar
  • 11
1 vote
2 answers
62 views

I'm having a issue with mouse click being tied to JFrame location while a BufferedImage is being displayed and setting the location of the mouse click relative to the scaling of a zoom. (code is from ...
user27466996's user avatar
0 votes
2 answers
97 views

I'm in the process of testing combining a JPanel (controls) and JTable (the data) in the same frame and have run into issues when trying to resize the JFrame that contains them. The first issue I am ...
Andrew L's user avatar
  • 313
-2 votes
1 answer
75 views

the window appeared like this: this is my code: import java.awt.Color; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JPanel; public class gui2 { public static ...
Nikel Halogen's user avatar
1 vote
2 answers
686 views

Im new to programming and following this tutorial for a weather gui app in java. Below is the very small amount of code I'm working with so far. Where I am getting errors is at the "super(...
2012anonBO2's user avatar
1 vote
0 answers
67 views

I am trying to make a 2D game using Java Swing, but I am running into some trouble. I added ZOrder to my JLabels because I wanted them to appear in a certain order, but it caused them to start ...
asdadada's user avatar
0 votes
1 answer
63 views

So I am writing a program which has several layers of menus using a JFrame with JButtons but once the user clicks a button that button ends up stuck as selected and I cannot update it. Any help please?...
Alex Parker's user avatar
0 votes
1 answer
109 views

I'm trying to draw a chess piece on the board I created but keep getting an error that seems my picture can't be found. Exception in thread "main" java.lang.IllegalArgumentException: input ==...
Anthony McKinney's user avatar
2 votes
1 answer
78 views

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. ...
LonelyBoi404's user avatar
0 votes
1 answer
40 views

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. ...
Freddy Redpath's user avatar
0 votes
1 answer
55 views

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 ...
user25673196's user avatar
0 votes
2 answers
640 views

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): ...
Bud McGinty's user avatar
0 votes
0 answers
28 views

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....
William Hughes's user avatar
0 votes
1 answer
73 views

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 ...
Mile's user avatar
  • 1
0 votes
1 answer
98 views

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; ...
Umang Lunia's user avatar
1 vote
0 answers
60 views

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 ...
domk's user avatar
  • 19
0 votes
0 answers
59 views

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 ...
Arom Moises Ruiz Gonzales's user avatar
1 vote
1 answer
93 views

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 ...
Wurstbrot's user avatar
0 votes
0 answers
63 views

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 ...
BigDaddyX's user avatar
1 vote
1 answer
80 views

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: ...
TechnicalVessel's user avatar
0 votes
0 answers
42 views

this is the code import javax.swing.*; public class test { public static void main(String[] args) { System.out.print("Starting up..."); createWindow(); } private ...
Örlygur Hugason's user avatar
-1 votes
1 answer
40 views

I'm writing a Java program that generates 5 random letters when user press G. After pressing G, if user press S, the next pressed key would be compared to the random generated letters to check if it ...
jared-dev's user avatar
  • 131
0 votes
2 answers
81 views

I am trying out a java with Ant slideshow in a video I found. I have made the output, and the window is appearing, but none of the images are being shown. I suspect I have done something wrong ...
Alonzo Rebucas's user avatar
0 votes
1 answer
77 views

I'm currently working on a small utility window for another application and I'm running into the issue that KeyListener input stops detecting input while a user is focused on a JTextField. I've made a ...
ObSp's user avatar
  • 31

1
2 3 4 5
200