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

learn more… | top users | synonyms

5
votes
0answers
24 views

PanelScrollable - a reusable class for rendering a changeable number of panels

This class (PanelScrollable) is part of my view package, in an MVP designed Java Swing system. I am not using any MVP ...
10
votes
1answer
131 views

Basic Calculator in Java with Swing

I used a standard calculator design from Java. I wanted to expand it so I created a class to create buttons for different operations, like +, ...
4
votes
2answers
59 views

Did I properly encapsulate this package?

My goal is to make File_Path_Handler constructor the only thing a user can access. Oh, is it too coupled? but the main question is: is File_Path_Handler the only accessible part of this package? ...
4
votes
2answers
98 views

How many squares can you see?

With a positive outlook, I posted this challenge at Programming Puzzles & Code Golf. I tried to come up with my own solution to the challenge which is as follows: The output is displayed (not ...
4
votes
1answer
46 views

Correctly implementing the Swing TreeModel

Ideally the Code Review would target the correctness of the approach implementing the Swing TreeModel. In particular, is the structural separation[1], event message passing, threading[2], object ...
10
votes
2answers
58 views

Component-oriented implementation of JList

One of the main problems I have with JList is that no component is actually added to it. This means that things like ...
6
votes
3answers
93 views

Reducing repetition and utlizing EDT

I am working on the largest Java program I have undertaken to date and feel uncertain in my current code practices. I think that I state and repeat things that don't need to be which can become a ...
4
votes
2answers
88 views

Long Thread & EDT

I’m trying to make a simple gui app that starts a “long” process that can be started and stopped. The process generates random numbers and displays them in a JList. As numbers are being displayed ...
7
votes
1answer
101 views

Card layout in Java

I have a JPanel (mainPanel) with CardLayout which contains 4 JPanels (childPanel). Each childPanel contains: a JPopupMenu ...
7
votes
1answer
327 views

Drawing a triangle and some concentric circles

For class, I had to use Java to draw a triangle and some concentric circles. Here's my code (questions follow): ...
10
votes
1answer
90 views

Follow-up to tool for posting Code Review questions

Description This is a follow-up question to Tool for creating Code Review questions. Things that has changed include: Removed replacing four spaces with one tab, all tabs and all spaces in the ...
10
votes
2answers
87 views

Tool for creating Code Review questions

Description I have realized that there's a whole bunch of code I want to have reviewed, but copying file by file, selecting the code and pressing Ctrl + K is a slow process, and I want to remember ...
7
votes
1answer
349 views

Java Calculator

I tried to make a calculator in Java and have added some stuff. I'm a beginner and have learned yesterday how to make buttons. ...
0
votes
2answers
70 views

A whole bunch of JButtons

Please review this code. ...
6
votes
2answers
171 views

Java GUI code with Swing Timer

I have the following questions for the below code: Is there a simpler implementation of an on-screen counter? I made CountTimer inner class since it's tightly ...
5
votes
1answer
107 views

A Program that Finds Empty Folders

I wrote a program that finds empty folders and subfolders in a directory. It's the first program I've ever written in Java, and I'd like some critique. I feel like I'm not utilizing classes in a very ...
1
vote
2answers
125 views

Shortening code to create a JFrame

I'm new to Java and have just started making JFrames. I wrote a program for a game project I'm working on and would like help on where I can improve. I'm not new to ...
5
votes
2answers
158 views

Splitting the GUI into smaller classes

I am currently working on a course project and have been assigned to write a GUI. I've written it and it's about 2000 lines of code. It will be bigger when I add the SQL codes and new panels. So, ...
5
votes
1answer
174 views

GUI design in Java Swing

I am developing a GUI using Swing, but before my project gets too complex. I would like to have a good design structure. I have a few ideas and will use a simple example to illustrate. Some feedback ...
2
votes
1answer
72 views

Create GUI components with states

I am asking about the right way to make a component that holds some state. This includes a Jbutton that saves a color in it, or a list item that saves a certain object. So when those GUI components ...
2
votes
1answer
116 views

Improving my “Guess Who?” game

I have a project in school. This is the game that I've created, but I need to make some improvements. I put a swing.timer inside the action event to create a ...
3
votes
2answers
2k views

Number-guessing game in Java with Swing UI

I am trying not to pick up any bad habits while improving the way I write programs. Any suggestions on the following lines of code? ...
3
votes
1answer
150 views

Custom component organization system

I'm rewriting an old Swing project that I did a few months ago, a fairly simple copy-cat of MS paint. I've been doing a pretty good job of keeping the code maintainable and organized, but I've hit a ...
4
votes
2answers
122 views

Table model code style

This is my table model code style: ...
0
votes
1answer
241 views

Best practice on implementing Java Swing Callback

I guess I am at the design stage and as such dont have actual code to review so this might be the wrong place to ask this in which case let me know and happy to close/move the question I am trying to ...
9
votes
3answers
4k views

Simple Java animation with Swing

Let me preface this by saying that I am new to this site as well as Java programming language. This site was recommended to my by a friend. That aside, let me thank you for taking the time to read ...
3
votes
1answer
64 views

Guice custom behavior for testing, how is this solution?

I have a Java/Swing/Guice application that uses multiple frames. When the application runs normally, I just want some of these frames to hide (and the "master" frame can unhide them). When testing ...
0
votes
3answers
262 views

Eliminating global variables in GUI program

I'm just getting started on GUI programming using swing in Java, and I would love some critiques on my code. I understand there is a danger in using global variables. If someone can hint me on how to ...
0
votes
1answer
2k views

Stuck with Multi-Client Chat Application

I'm trying to make a MultiClient Chat Application in which the chat is implemented in the client window. I've tried server and client code for the same. I've got two problems: A. I believe the code ...
0
votes
1answer
338 views

Separating presentation from the GUI

I'm a novice at Java and just beginning with Swing. I’m trying to figure out how to separate event logic from the presentation logic. Look at the following classes: GUITest.java ...
1
vote
1answer
61 views

Single Player Pong - Java

I recently created the following code: Pong class: ...
-1
votes
1answer
258 views

GUI using Swings - Different Answers every time [closed]

I tried to create a love calculator and the coding is here. It should give the same answer but it's changing every time. The logic is to get the ASCII value of each characters of both names and add it ...
6
votes
1answer
186 views

Code Review for Pong in Java

I have recently written the following Pong game in Java: Pong class: ...
1
vote
2answers
466 views

Nested layouts - BoxLayout inside BorderLayout

I have this code: ...
3
votes
1answer
3k views

Hangman in Java

I have the following code in Java: HangmanFunctions class: ...
1
vote
2answers
104 views

How can I improve and clean up that code?

how can I improve the following two views? And should the action listeners stay in the views? Thank you StudentView.java ...
2
votes
3answers
272 views

Game Of Life 3 in Java

I have this version of John Conway's Game Of Life in Java: Frame class: ...
1
vote
1answer
281 views

Better Design Pattern For Terminal-Like GUI

I am working on a java swing project that looks like a Terminal (but with less functionality). The GUI contains a jTextArea to ...
3
votes
1answer
154 views

Game of Life Animation Java

I have this Board class: ...
7
votes
1answer
249 views

Student administration application

I have set up a basic MVC project which is a student administration application based upon a CSV file as datastore. Each user has a specific role (student, lecturer, professor, leader of degree ...
1
vote
1answer
195 views

Space Invaders Game (Java/Swing) [closed]

Recently I have been working on a project in Java for a class in high school: a Space Invaders game. I was wondering if anyone could review it and point out anything I could change to help improve ...
2
votes
1answer
236 views

Applying DocumentListener on multiple JTextField

Say I have 5 JTextField: jTextField1, jTextField2... Now I want them to behave the same on ...
1
vote
1answer
322 views

Some feedback on first attempt to write Java MVC app

I'm writing my first Java MVC application which should be a desktop student administration application with a swing gui. DAO is already implemented: Need some feedback - student administration ...
1
vote
1answer
2k views

Code review for my (incredibly simple) chat room Swing GUI

world. I need somebody to review and polish my GUI code for my very very simple chat client. I haven't built any of the server sockets, so I'll do that later, but for now I just want people to tell me ...
3
votes
1answer
116 views

Sierpinski gasket - patterns from primes

Below is the code I have written. I started yesterday with prime numbers and playing around with them. What the code does it determines the "prime gap" between primes numbers, prints them, then finds ...
1
vote
1answer
352 views

Code Review/corrections on my Create Account program

I just finished a program that is simple Swing GUI. It takes in User Info, such as password & username, turns them into strings, and puts them in a text file called nuserInfo.txt. I just want ...
4
votes
1answer
164 views

Java/Swing GUI code/layout, am I doing this wrong?

I've never done Java GUI's before. After much trouble I've gotten my GUI to look how I want, however it feels as if my code is very inefficient, as if I'm going about this the wrong way? ...
1
vote
1answer
85 views

how do I encapsulate this List<Message> properly?

I know that Swing isn't true MVC: Using this modified MVC helps to more completely decouple the model from the view. Leaving aside the veracity of the above claim, the problem I run into is ...
1
vote
1answer
3k views

How to update my Swing JTable dynamically. MVC Pattern

I have created a program using a version of MVC architecture. The purpose of the code is to scrape the h1 titles of a list of webpages and to return the results to ...
3
votes
1answer
329 views

Design Pattern for Swing application

I have a Swing application with no real design pattern. I want to start learning to design Swing or any types of application properly. Here is the main JFrame ...