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

learn more… | top users | synonyms

5
votes
1answer
44 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 ...
5
votes
2answers
66 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
28 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
39 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
1answer
88 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
222 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 ...
3
votes
0answers
38 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: guimusic/main this contains all all of ...
4
votes
1answer
42 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
83 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
226 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
835 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
133 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
478 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
96 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
187 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
148 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
155 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
87 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
102 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
59 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
37 views

Managing Layouts in MigLayout

The following code creates a JFrame with a JTextField array in it. It also creates a ...
3
votes
1answer
94 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
99 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 ...
2
votes
0answers
59 views

Model view controller

I will be implementing MVC model in my program but before that, I have done a simple program based on my understanding of the MVC model. I have three pages: The user will enter a value in page one ...
1
vote
0answers
29 views

MVC Swing Application

I want to make sure this is a good implementation of MVC. I started earlier with this code found here and it was horrible compared to what it is now. If it is a good implementation of MVC what, are ...
7
votes
1answer
112 views

Switch-Bulb GUI program

Here is my switch bulb GUI program: ...
2
votes
1answer
66 views

mouseClicked method

The below code is placed in a method . But it seems too large and I would like to shorten it. Is there a better way to do what it does? ...
7
votes
2answers
71 views

Graphics in Conway's Game of Life in Java

I recently coded a program to stimulate Conway's Game of Life. Originally, my program just printed an array of 1's and 0's where the 1's represented the "live" cells, but I tried to teach myself some ...
5
votes
3answers
365 views

Login for desktop application

I am building a login using an API call to a URL that returns JSON data. The login works and is functional but in terms of "correctness" and "professionalism", I am looking to get input from some of ...
10
votes
2answers
106 views

Keyboard music maker

I enjoy making silly programs every once in a while. This is one of them. It makes nice sounding notes that vary slightly depending on the key being entered into a ...
6
votes
2answers
168 views

“Lights off” puzzle

Lights Off is a puzzle game consisting of an \$n\times n\$ grid of lights. At the beginning of the game, some of the lights are switched on. When a light is activated, it and its four neighbors in the ...
5
votes
2answers
198 views

Simple calculator in Java using Swing and AWT

I wrote a simple calculator with general operations. Give me please some advice, suggestions, and criticism about my code: code design, readability, mistakes. Calculator.java ...
1
vote
2answers
71 views

Display A Random Tic-Tac-Toe Board Using Java Swing

This is the problem: (Game: display a tic-tac-toe board) Display a frame that contains nine labels. A label may display an image icon for X or and image icon for O. What to display is randomly ...
2
votes
0answers
52 views

Knowledge Catalogue

All that the program does is query a database that I have setup, when the user selects the returned fields, which are populated based on the selection of the field above it. The application is ...
8
votes
4answers
531 views

Ballistics and arithmetic calculator

I'm a beginner to Java and OOP, and I would really like to learn how to better organize my code! Over the course of a month or two, I made a calculator program with little functions I thought of here ...
8
votes
2answers
140 views

GUI 'simple notepad'

Please give feedback on all aspects of the code, whether it be the commenting, usage of methods, semantics or anything that can be improved. This code looks flawless to me, so any suggestions for ...
2
votes
0answers
66 views

XML to JTree app needs Model/View/Controller refactoring

I'm developing a JavaSE-1.7 Swing application that displays XML files as a JTree. This will be the base for further work, e.g. filtering nodes. My questions, as a ...
7
votes
1answer
82 views

Conversion calculator using polymorphism and Swing

This is my first attempt at a program (outside of school) and I was trying to implement and learn polymorphism on a conversion calculator for volumes and weights. I found myself using long ...
3
votes
1answer
226 views

Printing the month name for the month number

This program asks a user to input any number equal to or between 1-12. It then converts the number to a message that will be printed (Copy the program to see it yourself). Is there a way to make the ...
5
votes
1answer
49 views

Platformer with collisions

Today I started to build my first platformer, first time working with collisions and stuff. Now, surprisingly, everything seems to work, but since this is my first time creating a platformer and I'm ...
2
votes
1answer
33 views

Check for collision with side of screen

I thought of a program where you move a square with the arrow keys. I created it and asked a question about it on Stack Overflow. I copied the last code block of the accepted answer and tried to ...
1
vote
1answer
91 views

Changing color via JRadioButtons and JButtons

I've got my full program working as expected. My full program looks like this: I'm posting a part of my code which changes the color of the circle. The user can change the color of the circle via ...
11
votes
2answers
248 views

Beginner Minesweeper game

I wrote a basic Minesweeper game for practice. It consist 3 classes: Main - only as launcher Cell - controling behavior of single cell Board - coordinating behavior of cells. The hardest part for ...
12
votes
4answers
681 views

Gravity model for a simulator

I am designing a planetary system simulator. The coordinates used are standard for JPanel (0,0 in the upper left corner). My model is based on a class Body: ...
7
votes
3answers
232 views

First 4-function Swing calculator

This is for a high school class I'm taking. Any tips/improvements? ...
0
votes
1answer
43 views

Asking for a number in Java Swing

Is it good way of asking for a number? Should that function return 0 if there is an error? ...
6
votes
1answer
226 views

Paint rectangles to canvas using mouse

Just wanted to post this here to see if anyone has any critiques of my code, if I'm drawing the background image most efficiently, or if I'm doing anything which could benefit from obvious ...
6
votes
2answers
205 views

Heavily nested anonymous classes for Swing UIs

Oftentimes, I write small little dialogs or forms without a UI builder. I usually find myself having a lot of "container" panel variables that just float around. I found this leads to time-wasting ...
5
votes
2answers
78 views

A S.I.N checker, using Luhn's Algorithm, and created in swing.

I have created a program to validate a Canadian S.I.N. using Luhn's Algorithm, and was wondering if there was any way to make it more efficient. From what i can tell, it is already extremely ...
4
votes
1answer
78 views

Implementing Mitchell's best candidate algorithm

I have written an implementation of Mitchell's best candidate algorithm. Mitchell’s best-candidate algorithm generates a new random sample by creating k candidate samples and picking the best of k. ...