Questions tagged [swing]

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

Filter by
Sorted by
Tagged with
5
votes
2answers
9k views

Tic Tac Toe in Swing

This is a Tic Tac Toe game I wrote in Java (Swing). It fully works when detecting the winner or a tie. I'm wondering if there's any way I can improve it or clean it up. I'm trying to achieve a 3 by ...
6
votes
1answer
208 views

Trygve Reenskaug 's MVC specification

I was reading the MODELS - VIEWS - CONTROLLERS paper by Trygve Reenskaug from December 1979 and wanted to try an implementation with Java Swing from my understandings. Notes I have taken are as ...
2
votes
1answer
145 views

Implementation of MVC in a Java Swing app

I am planning to create a POS swing application (personal project) for small scale businesses in my local town. I just want to know if this is the right way of implementing MVC in a swing app (I have ...
1
vote
0answers
270 views

Adding JComboBox(s) to a JTable

This question is in continuation of my previous question I asked here. I'm trying to dynamically add JComboBox(s) to a JTable ...
2
votes
2answers
501 views

Java Game Of Life

my Java needed a little refresher so I implemented the Game of Life as a little excercise. The game is working as expected, but I'm sure there is some room for improvement. Here is the code (skipping ...
4
votes
3answers
383 views

Simple log-in to system

I am fairly new to the MVC paradigm and I am working with Swing at the moment. To test my understanding of MVC, I have written this simple program used to login in to a system. I was hoping someone ...
1
vote
0answers
681 views

Sticky notes in a Virtual JDesktop

I made a very practical program consisting of a virtual desktop with a right-click pop-up menu that brings up a button to open a 'stikinote.' These 'stikies' are simply little note-windows where text ...
2
votes
2answers
757 views

Login window in Swing using MVP

I am trying to grasp MVP (like so many) and although there are quite a few resources out there, I'm not sure I really get it. I am trying to do this without frameworks to really see what's going on. ...
2
votes
1answer
619 views

Battleship, Console Game

If someone wants to make a review of this bad code i'd be more than happy :) I do know i'm far from a programmer but i've just started and looking for small tips and stuff. ...
4
votes
1answer
65 views

Swing UI for a Virtual LaunchPad

I'm currently coding for a school project. I'm planning on creating a virtual and simple Launchpad. Here's the first part of my code which treats the graphical interface. I know it's not well ...
1
vote
2answers
1k views

Program that reads a string from the keyboard and tests whether it contains a valid date

I know this task could be done in more practical ways, but the professor only want us to solve it with the "if" statement. I tested and it meets the condition for each task, but I still feel this code ...
5
votes
3answers
552 views

Organizational Tool GUI with Java Swing (and GridBagLayout)

My first 'large' project is to create an organizational tool. Right now, it's pretty basic, but nevertheless functional in terms of the intent of the current release (v0.3.0). My main question is: '...
6
votes
1answer
6k views

Snake Game with Swing

I put my code below to ask you for a review and ask you if this can be considered a good and clean code? The game works just fine, I have encountered one issue though - the Food condition to not to ...
5
votes
1answer
607 views

Conways Game of Life in Swing, using OOP

I'm relatively new to coding and was wondering if anyone could review my code? I'm trying to get my head around the concepts of Object-oriented programming in particular. This is an implementation of ...
1
vote
0answers
62 views

URL encoder with MVC Pattern

I coded a little URL encoding tool to exercise the JAVA MVC pattern with SWING. Can somebody give me feedback if this is the right way to implement the MVC pattern? ...
4
votes
1answer
180 views

Video playlist interface in Swing

I wrote this piece of code for a GUI i am making, which is a playlist interface. I was wondering if I could write all of this code out differently, but to the point where it functions exactly the same,...
0
votes
3answers
2k views

Simple Java calculator in Swing

can you review this code for me? how do i make it better? ...
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 ...
1
vote
1answer
2k views

Enum of calculator operations

I'm making my first simple project which I decided would be a calculator and I'm kind of stuck on implementing the operations. I have two classes one of which is the GUI part and the other one ...
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 ...
0
votes
1answer
293 views

Multiple-choice vocabulary tester [closed]

...
3
votes
1answer
886 views

Java Swing Calculator

I've been learning java for over a year and I'm looking for better ways to learn and I'm trying to get a better idea of where I am as a programmer. I honestly have no clue if my code is good or bad. I'...
4
votes
1answer
205 views

JTable for employees in SQL table

I have been studying Java for 4 months and this project is what I came up with. I know I should make more classes and methods for quality but I am still learning. Please help to me if there is any ...
3
votes
0answers
486 views

Java Pong Game Using Swing

I've written a Pong game in Java using the Swing library, and while the code works, the ball seems to lag across the screen. Perhaps my code is inefficient. I've included only the Board class because ...
3
votes
1answer
2k views

Simple Calculator in Java and Swing

I'm new at this and I'm almost done with learning basic Java. I made this just to see if I could do it. I just want to know if there's anything I can do to make it better. ...
6
votes
2answers
1k views

Animation of java.awt.Polygons

I made a class capable of moving Polygons around on a Polygon in a mostly smooth manner. Disclaimer: this was part of a school project (thus the use of Polygon rather than Image), but this code is ...
5
votes
1answer
108 views

Confidential Sign-In Sheet in Java

I was requested to make a Sign-in program for the LGBTA Center at my university. They wanted something where anyone that came by and visited could leave their name and email, but also so that no one ...
1
vote
1answer
2k views

Custom TableRowSorter - New sort order

The purpose of this custom TableRowSorter is to provide me with a different sort order of the columns. It changes the sort order from...
4
votes
3answers
3k views

Swing Temperature Converter

I made a simple temperature converter to serve as an introduction to swing. I used Eclipse WindowBuilder and did not attempt to make the components more modular. I'm curious as to how you guys would ...
4
votes
3answers
5k views

Simple magic 8 ball program

I would just like some input on how I may improve my code(in terms of content not formatting) without changing the output. It's just a simple magic 8 ball program using dialog boxes. ...
1
vote
1answer
338 views

Basic 4-function Java Calculator with Swing

I can see that there are a lot of java calculators on here, so I hope it hasn't gotten too old. This is a basic 4-function calculator in java using the swing interface. I am positive that it is ...
4
votes
1answer
211 views

Guessing game - Is it a 40?

User has number in head, the program must guess the number. ...
4
votes
1answer
1k views

2 Player TicTacToe Game

I am a beginner Java programmer and I have just finished creating a simple 2 player TicTacToe game and would appreciate some feedback/advice on how to make it better. ...
1
vote
1answer
746 views

Integer sum program

This is a little assignment I am working on. I am a beginner Java programmer and would love some advice on how to improve this code. For more context, here are the assignment details: Create a ...
3
votes
1answer
454 views

Tic Tac Toe against Al

I'm working on a project that has an option to playing against Al, so I started to make it in a separate class and just extended the main class which has an object of a GUI class which draws the ...
3
votes
0answers
102 views

JFreeChart generic plotting tool

I have created a bit of code that plots data for a project (XY Line Chart). It works. But it isn't what I'd consider good. I am looking to improve it in two ways: Make it more generic, so that I can ...
7
votes
3answers
535 views

Swinging Tic-Tac-Toe

This is just a simple PvP tic tac toe program, I'm learning and just looking for maybe some feedback on how to improve it? There are mainly two things I can see improvement for, the action listener ...
2
votes
2answers
70 views

SQL Query to display minimum prices per country

I have developed a Tender management System sort of code for one of my client. This is the piece of code : ...
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? ...
3
votes
1answer
1k views

SpaceWar game in java

I made this game which should imitate a spaceship and obstacles (planets). Move spaceship and try to hit everything. I will add some others features and functionality (better images or whatever). I ...
6
votes
2answers
672 views

A simple Python IDE in Java Swing

I've made an IDE in Java, using swing. It uses a couple of resources (prefs.json and help.txt) and some imported .jar files for reading the JSON. I know the code's quite long, but the answer doesn't ...
5
votes
1answer
91 views

Displaying game progress in a JApplet

I gave myself a small project to work on and at first I wanted to use the MVC approach, but I got confused as to which part of my code should go into which class. I did some research and still don't ...
1
vote
1answer
64 views

File-copying Manager

I have the following java class which has many private variables and methods: ...
6
votes
1answer
933 views

Ping Pong game in Java

This is my first application in Java, it imitates the world-known Ping Pong Game. I have a lot of questions in my mind... I read that the class Timer is not ...
1
vote
0answers
104 views

Customized JPanel desing pattern

This is an example of the Java Swing application I've wrote. I'm trying to follow the first Effective Java items. I wrote some classes similar so I've posted only this class for the review. ...
4
votes
1answer
100 views

Swing Game EyeHandCoordination

Question copied from the book: (Game: eye-hand coordination) Write a program that displays a circle of radius 10 pixels filled with a random color at a random location on a panel, as shown in ...
1
vote
3answers
582 views

Random password generator in Java

I made a random password generator in Java using a GUI. In the program, the user can choose the length, and whether to include lowercase letters, uppercase letters, symbols or numbers in the password. ...
0
votes
1answer
153 views

Highlight Two Closest Points Java Swing

Question from the book: (Geometry: closest pair of points) Write a program that lets the user click on the panel to dynamically create points. Initially, the panel is empty. When a panel has two or ...
7
votes
3answers
2k views

Morse code translator GUI

I made a Morse code translator in Java in which a user inputs a word/words into a text field and the program converts it to Morse code and beeps the Morse code. I have a feeling that my code could be ...
2
votes
0answers
438 views

Swing keybinding to control an animated car

In my textbook there is no mention of keybindings and it encourages the use of keylistener so there isn't any example code using keybindings for its problems. I was wondering if this is sorta close to ...

1 2
3
4 5
9