Swing is the name for the GUI toolkit that is packaged with the standard Java SDK. (since 1.2)

learn more… | top users | synonyms

-1
votes
0answers
31 views

Physics with bouncing balls [on hold]

I'm trying to create bouncing balls with realistic physics. At the moment, when the balls hit each other, they bounce back in the same direction they were coming from, now, I've searched the internet ...
5
votes
1answer
43 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
31 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
75 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
164 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 ...
11
votes
4answers
642 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
173 views

First 4-function Swing calculator

This is for a high school class I'm taking. Any tips/improvements? ...
0
votes
1answer
36 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? ...
1
vote
1answer
35 views

Java Tic Tac Toe [closed]

I'd like to review my Tic Tac Toe Java Code. Everything works, but checkwinner doesn't yet factor for a tie. Are there any oversights in my chosen values? Do I not have my player 1 and 2 variables set ...
6
votes
1answer
170 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
186 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
47 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
59 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. ...
11
votes
5answers
822 views

Simple Java calculator using Swing

This is a Java calculator I made for my programming class. I know there must be vast room for improvement. Please bear in mind the fact that this only accepts an integer, then an operator, then ...
3
votes
1answer
61 views

Full screen countdown display

As a part of a bigger application, I wrote code which creates a display for a countdown of a given time. It is nothing fancy, but I would still appreciate a review. I am especially concerned about: ...
5
votes
2answers
185 views

Length Converter

I have a Swing application that converts lengths. Inches to centimeter, feet to yard, etc. I’m wondering if I could make the super large HashMap a little smaller, or more efficient. Any other ...
7
votes
2answers
163 views

JPaint (Java painting app)

I have this painting app called JPaint in Java and I'm wondering if it could be improved. The variable declaration seems repetitive and long, and I think it might ...
3
votes
1answer
64 views

Cinema scheduling

Even though I have asked a question here related to my app using Swing and creating JPanel, I still have other ones about best practice making applications. I'm ...
2
votes
0answers
29 views

Drawing the appropriate shapes onto JFrames

To write a Java class that reads through a text file of drawing commands and draws the appropriate shapes onto JFrames, I have input instructions as follows: ...
2
votes
0answers
38 views

Action Event and checking buttons

I am creating a simple program with multiple buttons. Is this way of checking which button was pressed is ok? Is it better to use switch..case.. statement? ...
6
votes
1answer
86 views

Separating Cats and Dogs

I'm writing an animal shelter program, which keeps a database of different classes of animals (dog, cat, monkey). Functions that create the form and add the animals are very similar (difference is two ...
0
votes
0answers
66 views

Extending ProgressBarUI for modifying the look of a JProgressBar in Java

I have this visual mod for a javax.swing.JProgressBar: ...
4
votes
1answer
112 views

Using swing and creating JPanel

I watched bunch of videos about swing and GUI in general and created my first component (correct me if it is not one). JPanel class: ...
4
votes
1answer
65 views

Replicating a file system

The goal of this is just to practice. I went off on a self-challenge to replicate something(So the names of the parts can be ignored), I'm not done yet (Though what is here is fully runnable), but ...
3
votes
1answer
38 views

Simulating a GUI windowing system - follow-up

The previous and initial iteration at Simulating a GUI windowing system I have essentially cleaned the code based on the only answer. Now I have: MyCanvas.java: ...
10
votes
1answer
447 views

Beginner text editor

I wrote a simple text editor and I would like to get some critical comments. Below I present only a main part of code. I removed icons, irrelevant functions, etc. I am aware,that JTextArea is not best ...
10
votes
1answer
100 views

Hangman game using Java 8

I’ve been getting used to Java and I’ve written a simple hangman game using event-driven programming in Java 8. Please let me know of any improvements regarding the readability and design of the ...
3
votes
1answer
140 views

GUI flashcard program in Java

I'm new to Java and I've written a flashcard program in Java 8 that allows the user to create a collection of flashcards and then test themselves using those flashcards. Please provide any ...
5
votes
1answer
29 views

Determining prices for wholesalers or retailers

It is my first year in college and I have designed a code using pretty much my own basic knowledge. I have designed a program to work out the price of items for wholesalers or retailers. Special ...
4
votes
2answers
68 views

Program for a packing company

It's my first year in college studying Java so please excuse my ignorance in programming. This is my 5th Task in my Sequential Programming assignment, where we had to design a program for a packing ...
14
votes
1answer
235 views

Simple Java Wizard

Working on a project, I encountered a need to create a wizard and when I ran into the need for a second, slightly different wizard, I generalized into these classes. I originally based it off of this ...
2
votes
0answers
78 views

Simple Java MIDI player followup

This is my second iteration of a simple Java MIDI player. I've made several amendments and would like to see if the code is now correctly implemented and readable. This follows on from the first ...
6
votes
1answer
72 views

Simple Java MIDI player

I created a simple program that allows you to create and play MIDI sounds. I've used the MVC approach and I’d like to know if there are any improvements to be made regarding the design and structure ...
2
votes
2answers
56 views

Timer for a Java game

I have a simple game that implements a TimerTask. However, when there's a popup using JOptionPane the timer task doesn't seem to ...
7
votes
2answers
127 views

Simple calculator implemented with lambdas

I was searching for a way to exercise the Java 8 concepts I've been learning, especially pertaining to Lambdas. Incidentally, I hadn't used any swing in a while and wanted a refresher. This is the ...
13
votes
1answer
99 views

Creation of Queen Ann's Lace fractal

I've created a program which recreates the Queen Ann's Lace fractal. However, when the amount of points that are being plotted increases, the points are plotted way slower. Is there any way to make it ...
11
votes
2answers
176 views

Factman - A two player numbers game

I'm not sure if anyone else has ever heard of Factman, or even where the name comes from, but my AP Computer Science teacher calls this project Factman, so that's what I'm going with. Naming aside, ...
6
votes
2answers
596 views

TicTacToe GUI needs optimizing

I've been working on a TicTacToe GUI. While the game works with a proper restart, exit and win conditions; I feel that it could still be better optimized. I'm not particularly concerned with the ...
5
votes
2answers
220 views

Java MVC model for large scale GUI using annotations

I'm trying to make a good MVC model using annotations, which I will use it in a large scale GUI project. I want to respect the maximum of rules and guidelines, and be able to decorrelate every parts ...
9
votes
3answers
294 views

Workout tracker

Around June of last year, I made my very first GUI 'app.' Wish I knew of this amazing site then, I thought for posterity's sake it would be great to get it reviewed. It's a simple I/O window just to ...
4
votes
1answer
490 views

Start of Login and Address book GUI in Java

In GUI that provided with the right username and password lets you open up an address book like GUI where you have crud like operations. I'm still very inexperienced with swing facilities especially ...
11
votes
2answers
1k views

Add JPanel to JFrame

I just finished a fairly easy homework assignment. Basically all I had to do was add six JPanels that were just text boxes with color names as the text. However, ...
8
votes
2answers
233 views

Slide-Game in Swing

This was done as an assignment in school. As I am still learning some of the basic parts of Java be merciless when it comes to my code. As it is an assignment, some things are unchangeable. The ...
2
votes
0answers
69 views

Graphical Flowchart Programming

This is an incomplete implementation of something similar to scratch. It's incomplete because right now, I'm working purely on the user interface. I used Swing to make the basics of it, but then ...
7
votes
1answer
146 views

Sorting Algorithm Visualizer

Over the course of the past month I've worked on a little visualizer to show how different algorithms are sorted. I'm pretty happy with how it turned out but would be interested in any feedback ...
8
votes
1answer
92 views

Simulating a GUI windowing system

I was eager to learn the implementation details behind windowing GUI systems. Because I am mostly a high level programmer having not much experience in low-level stuff, I had to simulate it instead of ...
5
votes
3answers
510 views

Multiple random falling objects animation in Java

I am new to programming but I tried to make my code as readable as possible! Hopefully you can see what it does before you run the program. I did not implement a ups or fps controller, the animation ...
5
votes
1answer
60 views

JFrame with four sliders

I am writing a control panel with Sliders but I think my code is messy and cumbersome, what can I do to improve it? ...
5
votes
2answers
314 views

Inserting values of Date type into a MySQL database

I have got a JTable implementing a TableModel interface. There are ID (primary key, ...
5
votes
1answer
90 views

Macroing program with Java

When you press CTRL you activate the "Register" mode. In this mode, when you click, the program stores the X and Y of the mouse. To turn it off, you press CTRL again. When you turn "Register" mode ...