Swing is a GUI toolkit packaged with the standard Java SDK since version 1.2.

learn more… | top users | synonyms

2
votes
2answers
296 views

Medical diagnosis selector

Alright, so my code is 'all over' and missing some fundamentals as regarding to the MVC design pattern.I should separate my concerns and I don't have a model layer and i'm clueless to how to implement ...
5
votes
2answers
143 views

“I'm Listening”

For this next assignment, my job was to create a GUI with a button that changes text and color when clicked, and a slider that updates a label (with a TitledBorder) ...
5
votes
2answers
54 views

Create generic HTML calendar

I maintain our organizations intranet page as an additional duty. One thing that every department in the organization likes to use is calendars -- upcoming events, training, etc. At first I was only ...
0
votes
2answers
31 views

Java Swing Text Editor

Creating my first program in Swing and I was hoping to get some feedback. I'm looking for constructive criticism and tips for my swing code and my code in general. Don't really know what I'm doing so ...
3
votes
1answer
44 views

Java Swing Pong game

I recently created pong game using Java. This is my first time not copying any code from the internet or using any help. While it does work, my code feels well written but no streamlined or smooth ...
3
votes
1answer
25 views

Piano Tiles-like-Game: Mouse LorMorR

I'm currently trying to get somewhat familiar with swing and so I made a little Game called Mouse LorMorR (Mouse Left or Middle or Right). The Game consists of a timer, a score display and three ...
3
votes
1answer
36 views

Making use of Events in Java Swing and scaling shapes

I have this project that should respond to events. Can my code can be refactored and become shorter? Am I using actionListener properly? ...
3
votes
2answers
49 views

Conditional logic to determine if popup menu should be visible

I have this small piece of code written in a class. I am looking for a nicer way to write this, preferably avoiding nested if statements like what I currently have: ...
1
vote
1answer
31 views

Swing Food Menu

I want to know is it possible to re factor my code in such a way to remove duplication of almost identical statements, bar the variable name and what it is initialized to by using methods. Here is the ...
0
votes
2answers
46 views

JLabel formatting on GPA calculator

I am currently working on a GPA Calculator side project over holiday break to become more familiar with Swing, but I find the number formatting is more complicated than in regular Java. At the moment ...
7
votes
3answers
139 views

Swing UI for database-to-Excel tool

I'm just wondering what is the cleanest way you can write your GUI/Swing code? Right below is the code I have for my main frame. Could you guys let me know if it looks clean/understandable, and if ...
3
votes
1answer
45 views

Authentication program in Swing

It is a simple program which allows you to input a username an password. If the username/password is equal to the String it launches a JOptionPane that says ...
10
votes
1answer
167 views

Simon Says: “Optimizations!”

A while back I asked a question about my Simon Says game and did well on my assignment! But now we need to go back in a make some modifications to the game to be more advanced. I've done that as well, ...
3
votes
1answer
110 views

Monitor, read and display data from a dynamic log file

I am developing a plugin for intellij that basically monitors a log file and displays the data in a tool window within the IDE in real-time. I have managed to get it working but I would like to know ...
2
votes
2answers
59 views

Using actionPerformed() to call different methods per radio button selection

My Java is very rusty and I have been unlucky finding a better way to accomplish this task. I have two different methods which get called based on which radio button is selected. Is there a cleaner ...
3
votes
0answers
39 views

Change an identifier in a .csv file, based on another .csv file

I have only dabbled in Java before (my previous experience being mostly with PHP and JavaScript) but a request come through for a small application that seemed like a good chance to get some ...
3
votes
2answers
211 views

Java Temperature Converter GUI

Today is my first time working with GUI, so I'm really interested in the best ways of handling various events to get the best habits from the jump. Most of the GUI-related code for this project was ...
5
votes
2answers
34 views

Vertical JButton allignment

I have created a simple component in Swing that lets me place other components such as buttons on top of each other. They fill their parent horizontally but not vertically, which is exactly as I want ...
4
votes
1answer
409 views

Java Dice Roller with GUI

Three days ago I wrote about a Java Dice Roller I wrote. I've now added a GUI to that program. Here it is: DiceRollerGUI.java: ...
2
votes
1answer
43 views

Having graphics resize in line with the Frame in Swing

I have drawn a box within my JPanel so that it resizes appropriately when the JFrame is resized. This is how I implement it: ...
13
votes
2answers
196 views

Learning by translating - Follow the Rubberduck - Part 2: Beta

This project is my learning place for a few things: MVP (model view presenter) XML (parsing, editing and leveraging) deeper swing functionality Concerning the XML part I have already recieved a ...
3
votes
0answers
48 views

Swing Component Resizer Class

I've created a class to help resize Swing components while maintaining their aspect ratio within a container. The class works by creating an instance and adding a container's components to it, then ...
7
votes
1answer
184 views

Board-tile game click event OOP pattern

This is actually an old 'problem' that I never really knew how to improve, but I'm wondering now if there is a better approach for this problem. I'm creating MineSweeper with Java and struggling with ...
6
votes
1answer
43 views

Class managing queuing updates from another thread, Version 2

This is an updated version of: Class to manage updates coming in from another thread Managing updates from other threads into Swing is a hard problem. In MVC design, if you don't want to have the ...
5
votes
2answers
59 views

Class to manage updates coming in from another thread

Managing updates from other threads into Swing is a hard problem. In MVC design, if you don't want to have the Presenter be responsible for Thread safety, you can end up with deadlock issues, and also ...
4
votes
1answer
356 views

BMR (Basal Metabolic Rate) Calculator

Been working on a BMR calculator on and off for a while now. Created an interface and been over different ways to store user input, different ways to calculate BMR/TDEE etc. I created another class ...
6
votes
3answers
121 views

Java Swing Application - Roleplaying Aid

I've been working on this utility for a while now, and have since gone through a couple reworks to try and increase the readability and best practices, but since I don't usually work a lot with Swing, ...
6
votes
1answer
265 views

Basic Java Swing Calculator

I am new to Java Swing and have decided to create a calculator to learn some of the basic. I would like someone to look over my code to see if they can give me any improvements. I have 6 classes and ...
7
votes
2answers
330 views

Basic game with moving objects in Swing

This is a simulation attempt of an "old-style game", where a "car" (nothing more than a red rectangle) must dodge some "obstacles" (blue squares) falling from the upper edge of the frame. If an ...
1
vote
0answers
33 views

Removing JLabels by pressing JButtons which disable if in excess

The goal of this code is to move some JLabels from (JLabel[] pileone) off a JFrame when a ...
0
votes
1answer
47 views

TableCellEditor for multiple columns

Is this the best way to do this? edit: I am wanting to use a cell editor and a DocumentFilter to prevent the user from entering certain characters into the table cells. The columns are as ...
6
votes
2answers
120 views

Classic two-player memory game

This is a classic memory game with a points counter for the two players. The app works fine, but since this is my first project in Swing, I would appreciate the critical opinion of some expert, as ...
6
votes
3answers
1k views

Get initials from full name

Going through a book, I encountered the following assignment: Write an application that asks for the user’s first, middle, and last names and replies with the user’s initials. Are there any ...
4
votes
1answer
77 views

GUI SQL interface for select insert and remove

This is my final project for my second Java class! I would like to get some feedback on it to see where and what I can improve. There are five class files: ...
4
votes
1answer
650 views

MVC Calculator Implementation with Java Swing

I know this might be a relatively large amount of code, but I'm just looking for any improvement, big or small, on my coding as I can. As part of my self-study in programming, I decided to make a ...
3
votes
2answers
210 views

Computing age in days with a graphical tool in Java

I was in the mood for doing some GUI coding, and eventually I came with this simple program: you enter a date, press the button, and the program tells you temporal difference in days between the input ...
5
votes
1answer
526 views

Calculator in Java using JFrame

Today, I made a calculator in JFrame. The code is a little long but I'm still a beginner to Java. In the future I'm going to do some improvements on it, but here it is right now. This is the meat of ...
10
votes
3answers
972 views

Beginner GUI Calculator

I'm very new to Java and programming and I've written a calculator to put all the theory I've learned so far into practice. I'm sure there is a lot of room for improvement since I really just started ...
12
votes
1answer
188 views

Beginner temperature converter

I'm a beginner to Java and programming in general and since I'm on a holiday to the US, I thought it would be a fun idea to write a program for converting Fahrenheit to Celsius and the other way ...
8
votes
4answers
665 views

Java GUI 2-input Calculator

I have written this code for a two input calculator. Is there anything I can do to make this code more efficient? ...
5
votes
1answer
110 views

Delete item in List A will also delete corresponding items in List B

This Java Swing code consists of 2 JLists and a delete button. When I select an item from locationList, it will also delete ...
7
votes
2answers
473 views

Java calculator using Swing

This is a simple calculator where the user can type out the calculation and hit enter, and the calculator would determine if it is a valid calculation or not by attempting to carry out the ...
13
votes
2answers
157 views

Ultimatoe — 2. The model

The game model (Ultimatoe) consists of 9 instances of Tic-Tac-Toe (UltimatoeBoard) and some auxiliary information. As the number ...
11
votes
1answer
203 views

Ultimatoe — 1. GUI and general game interfaces

For the community challenge, I wrote ultimatoe. For me, the most interesting part is clearly the AI, but what I did so far is just a stupid Monte Carlo tree search, which isn't ready for a review yet ...
5
votes
1answer
105 views

Click! program in Java Swing

I've created a program where the user is, at first, presented with a window with a yellow circle (random size, random coordinates) and a Start button. Once the user presses Start, the circle, when ...
1
vote
1answer
128 views

CSV File Reader Project

I'm trying to focus on learning so I can get an entry level position and the best way for me to learn right now is to have someone review and provide areas of improvement. This project isn't entirely ...
7
votes
2answers
70 views

Append user input to a database

This is my first time writing a Swing+Groovy application that successfully inserts data to SQL tables. It may look like example code, but it is more test code, as I will eventually expand this to a ...
2
votes
1answer
59 views

Managing Layouts in MigLayout

The following code creates a JFrame with a JTextField array in it. It also creates a ...
3
votes
1answer
256 views

Travelling Salesman Problem with visualisation in Java

For practicing purposes, I challenged myself to write a program that solves the TSP and visualises the results step by step. As for now, my program uses a simple nearest neighbour algorithm. I want ...
7
votes
1answer
189 views

Changing look and feel for all current frames

I am using JGoodies Looks to change the look and feel of the application I'm currently working on. I've just created a JMenu with some different themes options for ...