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

learn more… | top users | synonyms

2
votes
1answer
42 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
301 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, ...
2
votes
0answers
33 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
121 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 ...
4
votes
0answers
46 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
124 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
50 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
61 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
70 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 ...
2
votes
1answer
63 views

Using a List to manage Swing event listeners

I've been playing with an idea for simplifying management of event listeners on custom Swing components. Swing provides the EventListenerList class for maintaining events, and every JComponent has a ...
8
votes
1answer
140 views

Number Memory Game (JApplet)

I coded a JApplet game that allows the user to play a game that displays a sequence of 4 numbers that must then be input into a ...
3
votes
1answer
100 views

Adding action listener to Swing JButton

I'm aware that there are existing questions about JButtons, but I haven't found anything that's asking exactly what I'm trying to figure out. I inherited a Java ...
0
votes
0answers
96 views

Database assignment with MySQL and Swing

I have completed this assignment from Stanford CS108 on MySQL and Swing (it's part B). And it would be wonderful if someone could point out my week spots in code and overall design. I have uploaded ...
4
votes
2answers
109 views

Small password generator app with GUI, v2

GUI-based pseudo-random password generator. Modification of this app, improved according to suggestions from Code Review users. Additional feature: calculation of time to crack password on average ...
10
votes
4answers
355 views

Chess Architecture

I am currently developing a chess game but have made the mistake of putting all my Java code in one .java file. I need help cutting up my code into more manageable chucks. Could someone show me how ...
1
vote
0answers
39 views

Initiliasations for applet

I have the following code in my class and its init() method. It works fine as it is but I'm wondering if there's a better way to do this so that my init() and ...
3
votes
1answer
66 views

Swing application: Working with GridBagLayout and Mediator pattern

SCENARIO: As a follow-up of this question on Stackoverflow asked few days back, I am working on a swing application(article tagging tool) where the user(on an initial jpanel) would fill up some ...
3
votes
1answer
415 views

MySQL Java in JTable

This is an assignment posted here. (Part-B) The aim here is to create a GUI in which the user can search for and insert data into a particular table of a MySQL database. Is this an appropriate ...
13
votes
5answers
1k views

Small password generator app with GUI

This is a GUI-based random password generator, which supports internationalization. It consists of 6 small classes: Main classes: Application - entry point ...
2
votes
2answers
180 views

Using database connection and GUI

In my project there are a lot of GUI so I have a class for each GUI. I created a class to connect to my db (MySQL). Remember, I don't have problems with code not working. The code (important to this ...
4
votes
1answer
113 views

Simple Cellular Automata (think Conway's Game of Life) simulator

Firstly, let me say that this code works, as posted. It fills a 10x10 grid with a random color (black/white) then runs a cellular automata simulation on the grid, starting or pausing when the button ...
6
votes
1answer
145 views

Pokemon Type Evaluator part 2

I started anew and completely refactored the way I implemented Pokemon Type Evaluator. Also, first use of a lambda expression (Case of using it, but still don't fully grasp how it's working). I'm ...
7
votes
3answers
910 views

Simple FizzBuzz

I wanted to try FizzBuzz, but to do it in the most efficient way. I think this method employs most of the concepts I learned here. Is there anything unaccounted for? A sprinkle of Swing since that's ...
6
votes
2answers
94 views

Reorganize a maze game from one large class into smaller classes

I'm new to Java and I really don't understand how to make more classes work like one. So if anybody could explain and help me divide my large code into smaller classes (like Player.java, Main.java, ...
10
votes
7answers
900 views

Too-high / too-low guessing game in Swing

I have created this program and it works fine. It's just that its too wonky and huge so I was wondering if anyone knew how I could shorten the program so I didn't have to put all of these into each ...
7
votes
1answer
81 views

Determine maximum window bounds

Preamble: the default frame positioning with Swing JFrames has always bothered me. Eventually I wrote some code to calculate my available desktop space, not ...
10
votes
3answers
1k views

Pokemon Type Evaluator

I thought I would apply what I learned to make something fun. Its purpose is to type check Pokemon, for anyone familiar with the series. It mostly works but I have two concerns: Sometimes you write ...
5
votes
1answer
111 views

Pausing a SwingWorker with a Timer

I made a SwingWorker which is fetching tweets using the twitter4j API. The twitter API will allow 180 queries every 15 minutes, and then throw an exception with ...
2
votes
1answer
168 views

Opening contents of a file using Swing and SwingWorker class

I want to open a file contents using swing. For this I used the SwingWorker class. This application took more time (more than a minute) to load a large file ...
4
votes
1answer
82 views

Creating a “Produce and Consume” using Swingworkers

I am experimenting with the produce and consume concept while trying to incorporate it into my own project. I basically have two Workers in a small example I made: ...
2
votes
1answer
167 views

Breaking memory game code into MVC form

I am currently coding a memory game whereby upon the game starts with 14 cards displayed faced down. The player will start by clicking on 2 cards. The cards will be revealed. If both of the card ...
5
votes
1answer
80 views

Periodically checking for internet connection

I have a SwingWorker which checks periodically for an internet connection and updates a jLabel accordingly. ...
7
votes
3answers
782 views

Very Basic Java Piano

I've been reading "Head First Java" and some of the early projects surround basic swing and basic MIDI. So I've put the two together and written a basic "Synthesiser"/"Piano" using what I have ...
3
votes
1answer
96 views

Implementation of MVC pattern with paintComponent method

Could someone review my code, with respect to OOP, clean code and MVC pattern? Main app: ...
8
votes
1answer
125 views

Separating Logic from GUI

I am new to Java's Swing and built a test client that connects to a server. I was wondering if my use of a Controller class as a link between the classes ...
4
votes
1answer
122 views

Inefficient Stopwatch - revised

This is my revised code of Stopwatch: ...
5
votes
1answer
150 views

Inefficient Stopwatch

I have just finished a simple GUI stopwatch, but some of its code looks like it needs replacing. This is the code: Clock class (extends Thread): ...
2
votes
1answer
261 views

Simple Operations Calculator

I'm practicing Swing effects. Everything works but for some reason I get a ton of error messages in the command prompt when the fields are empty, despite my attempt to add some exception handling ...
6
votes
2answers
4k views

Basic Calculator using Java Swing and AWT

I created a basic desktop calculator using Java. Does anyone have any suggestions as far as coding best practices, readability issues, or just generic coding mistakes I might have missed? Any ...
6
votes
1answer
86 views

Rotating background using Swing: performance issues

In a jPanel, I'm displaying a 1203x1203 background that I rotate every 30ms. Problem is, Swing is known to be a slow library, and I assume rotating a huge picture at a quick rate would be quite ...
8
votes
2answers
5k views

Swing calculator - first GUI program

I've recently made a calculator using Java and Swing. I'm okay with the results but I'm curious what are the major flaws I've made (assuming there are, because it is my first program making GUI). I ...
5
votes
3answers
938 views

Small notepad editor

I decided on making a small notepad editor in Java using Swing and I think it functions pretty well. Unfortunately, my skills in making my project tidy and organized has abandoned me; it looks like ...
0
votes
2answers
155 views

Simple GUI using tabs to separate application windows

I'm designing a simple GUI using tabs to separate each 'window' of the application. There are 3 main tabs, each with 2 sub-tabs. In one class I create the entire hierarchy of panes and panels: ...
5
votes
1answer
992 views

MouseListener Lag in Piano Tiles game

I was attempting to write my own simple version of the Piano Tiles game app in Java just as a fun exercise. GameLogic.java ...
10
votes
1answer
495 views

Organizing code in small Mario game

I have a little Mario game I started working on realize that it's format is very messy, can anyone critique my code on how to make it better, faster, neater, easier to access. frame.java ...
7
votes
3answers
3k views

2048 game clone in Java

I made a 2048 game clone in Java for training, and I am trying to make it more efficient. The problem I found is the paintComponent() method always resets all the ...
6
votes
1answer
323 views

Simple stop watch

I'd like my code to be solid and good. That's why I want someone a little more experienced to give me some feedback so I can improve. Here is the code for a simple stop watch that I created. I feel ...
1
vote
1answer
246 views

MVC Layout - Which way to add listeners is better?

So I'm doing a basic MVC layout for a pretty basic game that I am making. The game requires the user to move up/down/left/right via buttons on the GUI. Since I'm using an MVC layout and my buttons are ...
4
votes
1answer
258 views

Winning Loop Connect 4

I am writing a fully functional single player Connect 4 game. I am working on the second player and the while loop that tells the player who won. GUI ...
7
votes
1answer
140 views

Interacting with GUI class and Main class

Usually when I make mock-up programs (like this one), I look for things I can improve on in case the situation happens again. Today I thought I'd brush up on basic OOP (I understand the concept of ...