Questions tagged [swing]

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

Filter by
Sorted by
Tagged with
93
votes
6answers
61k views

File Browser GUI

FileBro is a basic GUI based File Browser. FileBro Functionality Directory tree - shows the file system roots at start-up, but is otherwise built lazily as the user browses around the file system. ...
45
votes
2answers
925 views

Tool for creating CodeReview questions

To download the tool and for usage instructions, see the follow up to this question Description I have realized that there's a whole bunch of code I want to have reviewed, but copying file by file, ...
25
votes
5answers
96k views

Simple Java animation with Swing

I am learning to use Java Swing and have made a simple animation that makes a small shape bounce around the predetermined borders of a panel. The program works well, but I am looking for feedback in ...
25
votes
1answer
336 views

Follow-up to tool for posting CodeReview questions

Description This is a follow-up question to Tool for creating CodeReview questions. Things that has changed include: Removed replacing four spaces with one tab, all tabs and all spaces in the code ...
19
votes
1answer
3k 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 ...
17
votes
3answers
3k 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 ...
17
votes
5answers
4k 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 ...
16
votes
1answer
95k views

Pong game in Java

I have recently written the following Pong game in Java: Pong class: ...
15
votes
2answers
134k 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 ...
15
votes
2answers
2k views

Guessing game - am I using the concept of objects in Java properly?

I'm new to Java and find it hard to grasp the concept of objects. I wrote a simple guessing game to practice the concept of OO programming but I am not sure if I am doing it correctly. The objective ...
15
votes
1answer
203 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 ...
14
votes
2answers
251 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 ...
14
votes
2answers
196 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 ...
13
votes
1answer
27k views

Small Mario game

I have a little Mario game I started working on and I realized that its format is very messy. Can anyone critique my code on how to make it better, faster, neater, and easier to access? frame.java <...
13
votes
1answer
79k views

Java Snake game

I am a self - taught coder, and have been learning Java / C# for the last 2 1/2 years (inconsistently). I have recently created a snake game in Java with the help of an online tutorial. I have ...
13
votes
1answer
12k views

Snake Game in Java

I am a self-taught coder, and have been learning Java for the last 2 months. I have recently created a snake game in Java with the help of an online tutorial. I have rearranged the program into ...
12
votes
4answers
5k 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: ...
12
votes
2answers
13k views

Ping-Pong game in Java

I wrote a simple game in Java using Swing. Code is working so far but I have no certainty that "spliting" into classes is done well. I would like to know what "design" problems I have in my code. Also ...
12
votes
1answer
46k 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 +, ...
12
votes
1answer
1k 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 ...
11
votes
7answers
2k 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 ...
11
votes
5answers
9k 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 ...
11
votes
2answers
41k 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
2answers
14k 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, ...
11
votes
2answers
250 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 ...
11
votes
2answers
3k 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, ...
11
votes
1answer
574 views

Pokemon type evaluator - follow-up

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 ...
11
votes
1answer
535 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 (...
11
votes
1answer
907 views

Approach to programmatically building hierarchical GUI components

At work I am developing an application using hand-coded Swing, and I've found that I have an easier time reading, writing, and maintaining hierarchical component creation using code blocks like: <...
10
votes
4answers
2k 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 ...
10
votes
4answers
5k 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 ...
10
votes
1answer
1k 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, ...
10
votes
1answer
2k 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
147 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 frameworks,...
10
votes
2answers
325 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 ...
10
votes
1answer
3k 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 ...
10
votes
1answer
877 views

Swing UI for a test Websocket client

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 ...
9
votes
3answers
4k 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 ...
9
votes
3answers
17k 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 ...
9
votes
1answer
8k 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. ...
9
votes
2answers
3k 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 ...
9
votes
2answers
163 views

Optimize a tile rendering algorithm for Swing Canvas

I have an algorithm that I use to render a text GUI using Swing's Canvas, it looks like this in practice: My goal is to reach 60 frames per second for a full HD ...
8
votes
3answers
1k 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 ...
8
votes
2answers
925 views

Detecting Tiles in Java

My program detects what tile is being clicked and prints it to the console ...
8
votes
4answers
1k 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
4answers
5k 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? ...
8
votes
2answers
7k views

Velocity, Distance and Time Calculator

This is a velocity, distance, and time calculator that I wrote not too long ago. How can I improve upon this code? ...
8
votes
3answers
3k 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 ...
8
votes
1answer
716 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 ...
8
votes
2answers
2k 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 ...

1
2 3 4 5
9