9,977 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
63
views
Problems when trying to alternate frame transparency
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 ...
0
votes
2
answers
94
views
How to set an image filename
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 ...
0
votes
0
answers
22
views
Remove Jpanel from jframe
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 ...
1
vote
1
answer
66
views
How should I set up a JPanel to display with white space?
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 ...
2
votes
1
answer
75
views
How to reduce the height of a JPanel used as a header in Java Swing?
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 ...
0
votes
1
answer
135
views
Change titlebar of java swing by FlatLaf causes entire UI change
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 ...
0
votes
1
answer
81
views
adding items to a JPanel with a button
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 ...
0
votes
0
answers
80
views
My code has suddenly started cropping out sections of my JFrame with no changes or alterations to the code
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 ...
0
votes
0
answers
59
views
Why are my buttons not showing, only the label is visible? [duplicate]
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 ...
-1
votes
1
answer
67
views
Is it common practice in Java to add JPanels with custom layouts to a JFrame to organize components? [closed]
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 ...
0
votes
2
answers
84
views
Why does my JButton lose its full width when added via a JPanel in BorderLayout?
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 ...
-1
votes
3
answers
111
views
Swing: How to center a button near the bottom of a JFrame without using setBounds()?
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" ...
0
votes
1
answer
33
views
ActionListener cannot recognise my buttons?
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, ...
0
votes
1
answer
97
views
How to Display Items In JPanel to use for Inventory System?
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 ...
1
vote
1
answer
73
views
Creating a "second frame" for Full Screen in a Java app
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, ...