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

learn more… | top users | synonyms

1
vote
1answer
111 views

Winning logic for Tic Tac Toe and OO design

I'm a Java beginner and I've just started learning about GUI. However, I'm not sure about GUI coding conventions and whether I'm getting the object orientation part of it right. I feel like I'm ...
4
votes
1answer
52 views

Simple Java RSS reader

As a study project I was supposed to write an RSS reader in Java (I used Swing to make GUI) using MVC pattern. I finished it, but it's not quite polished yet (still gotta write these javadocs and add ...
3
votes
0answers
31 views

Bare bones painter app in Java - follow-up

See the previous iteration: Bare bones painter app in Java. I have improved my program thanks to all the answers in the initial post. Now I have this: App.java: ...
6
votes
2answers
897 views

Bare bones painter app in Java

See the next iteration: Bare bones painter app in Java - follow-up. I have this tiny program for drawing: PaintCanvas.java: ...
4
votes
0answers
59 views

Compacting code for World's Hardest Game remake

I was wondering if someone could quickly skim over this for me really quickly and tell me if there's anything I could improve code-wise. What I have right now seems pretty big and clustered, and I'm ...
4
votes
0answers
35 views

UI-based memory game

I have created a UI shown in the screenshot. I am initalizing too many JPanels within a panel in my code to achieve the UI which will lead to bad code design and ...
2
votes
0answers
18 views

GUI rogram connecting to SQL and listing information about products in specific category

This is my very first application written in Java and so I finalized it, solely because it occurred to be my thesis. It is a very simple program that lists categories (Northwind database is used as ...
1
vote
1answer
29 views

Checking for a win along the top row of a Tic Tac Toe board

This code works so far and it is a TicTacToe game (Personal Project of Mine). I'm kinda new to programming. My question is I really do not like how the Connected method is at all, because well it's ...
0
votes
0answers
42 views

Notepad Clone Text Editor

...
7
votes
1answer
116 views

Button-clicking UI for a game

I've been working on this game for a couple weeks now as a purely personal project to help myself learn Java. I'd like to know if I'm on the right track with my project. Items I'd like specific ...
7
votes
3answers
924 views

Simple Hangman game in Java

I'm teaching myself Java and I had some basic questions on how well I am writing my code for readability. I feel like sometimes I'm just writing code that works, and I'm not that proud of myself when ...
2
votes
1answer
105 views

Quiz program in Java

I have made this small quiz with 10 question and 40 JRadioButtons. One question and 4 JRadionButtons for each panel. So I had to ...
4
votes
0answers
67 views

Swing UI to display and edit terrain for a game

I would like someone to review my code and maybe give me some advice to maintain it because I'm still a beginner. ...
3
votes
2answers
102 views

Prime Number Calculator with GUI

I wrote a Java program with a Swing UI that calculates prime numbers. The primes are displayed into a listbox. I used a few optimizations to generate the primes faster. I’m using the NetBeans IDE, so ...
4
votes
1answer
46 views

Extremely Simple Paint Program in Java (Tips for making it run smoother?)

I have written a very basic paint program in java using awt and swing. I have separated the program into two different class files; one of them holds the JFrame and adds a custom panel (this custom ...
4
votes
3answers
183 views

Swing GUI in Java

I'm learning Java at the moment and I'm currently trying to make a GUI using Swing. I've done some reading and people usually prefer and advice to use composition instead of inheritance of e.g. ...
3
votes
1answer
68 views

Basic structure for interactive single window application

This is the basic structure I usually end up with whenever I'm writing a simple application. More recently I've learned about singletons and have started to incorporate them into my design, but other ...
1
vote
1answer
33 views

Animate an oval shape using Thread

I have this project that should continuously animating using for loop. Also I want to include variations on the position where the ball pass through. Can anyone please check my code if I am following ...
2
votes
0answers
142 views

Nice GUI for the sudoku solver in Java

I have implemented a GUI for my sudoku solver: You can use mouse for operating it, yet I have coded moving the cell cursor with keys wW/aA/sS/dD. My code ...
3
votes
1answer
71 views

Student information demo in Swing using MVC

I've followed several guides on how to implement MVC in Java, and so far I've come up with the classes shown below. From my understanding, MVC follows these guidelines. The Model should be ...
0
votes
0answers
29 views

Applying MVC design pattern to a Java SWING application

As the title says, for the last couple of hours, I've been trying to implement MVC design pattern into a project I've worked for a couple of days now. It took more time than expected and since the ...
3
votes
2answers
101 views

Basic TicTacToe game in java

I was assigned to create a simple Tic Tac Toe game in java for class, and here is what I got. I would like to know how the code could possibly be shortened without using really advanced topics since I ...
1
vote
1answer
35 views

Creating a new JFrame on label click

So I've been looking for examples on the internet for a while now and this seems the most common way everyone is suggesting, but now I ask is there a better way to make a new jframe pop up on click ...
3
votes
2answers
389 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
187 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) ...
6
votes
2answers
97 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 ...
1
vote
2answers
70 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
88 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 (...
4
votes
1answer
62 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
40 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
55 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
55 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
86 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
177 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
57 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
244 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
332 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
126 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
45 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
441 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
43 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
897 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
66 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: ...
14
votes
2answers
210 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
62 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
255 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
44 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
65 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
549 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 ...