Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [swing]

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

1
vote
0answers
43 views

Snake animation in Swing

I'm developing a simple Snake game in Java using Swing. So far I made the snake animation which is troubling me: when the snakes moves it seems like it starts to lag for no reason, but when I move it ...
1
vote
0answers
57 views

Java Swing “guess my number” game in Hexagonal architecture

Based on this article, I wrote a small "Guess my number" game in Hexagonal architecture which interacts with a Java Swing GUI adapter. Any feedback is appreciated. Main.java ...
1
vote
1answer
48 views

Keypress output to screen

For a school project, I had to make a keylistener that would output whatever you typed to the screen. A JFrame would be initialized to have the focus required for the listener to work. It uses delete ...
2
votes
1answer
56 views

Java League of Legends ping checker

I'm still a freshman and this one of my first projects I made using Java and Swing. The program is a simple League of Legends multi-threaded ping checker that pings the server 10 times to get an ...
1
vote
2answers
100 views

Tic Tac Toe Java Swing game

I just created a simple game. Now I'm thinking what could be done better here. I want to get some tips how to make the code better/easier or what to add to it. Code: ...
2
votes
0answers
37 views

Mouse wheel scrolling for nested scrollable Swing components

By default, mouse wheel scrolling in Java Swing behaves differently than in web browsers. In Swing, when you have an inner scrollable component and an outer scrollable component, the mouse wheel ...
2
votes
0answers
60 views

My first Java app: a calculator in Swing

I have created my first Java app. I am very familiar with C++ and thus without reading any books (just introduction, googling and IntelliJ auto-completion) I directly jumped into Java. So I made a ...
1
vote
0answers
22 views

Sorting an array of numbers in Java with an algorithm

This is pretty much one of my first programs that I have created in Java and I just wanted to ask if anyone sees some obvious errors or mistakes I made. The purpose of this program is to sort numbers ...
1
vote
2answers
206 views

Using decorator and strategy pattern for dynamically generating SQL queries

This is a link to my application that actually runs on the design specified in the image. The idea behind the image is that the SubjectInfoViewer behaves as the ...
2
votes
1answer
119 views

Simple Java OOP calculator with GUI

I'm learning Java and I've tried to write my own calculator with GUi based on this post. Here is the repo: https://github.com/MurDaD/java-calculator Could someone check my code and tell me how to ...
1
vote
1answer
124 views

Swing GUI application to change colour of circle with JSlider

The below code works as intended and I'm generally happy with it - the sliders each change an RGB value to modify the color of the circle in circlePanel. Likewise the diameter slider changes the size. ...
4
votes
1answer
64 views

Simple view for CRUD with miglayout

I have created the following view extending the JPanel class, the objective of this view is to allow the user to perform 3 CRUD operations create,delete and modify on the entity "Attribute", this ...
0
votes
1answer
98 views

10 minute Tic Tac Toe

After seeing Snake coded in 10 minutes, I decided to try a similar challenge, albeit easier. The following is Tic Tac Toe that I coded in 10 minutes. Given the short time frame, I'm sure there are ...
-1
votes
1answer
80 views

Java Multi-threaded Chat Room

In an attempt to learn more with Java, I decided to challenge myself by creating a GUI-based, multi-threaded chat room. Currently, you run the Client and it prompts you to either create or join a ...
2
votes
0answers
44 views

KeyEvent listener: mapping physical keyboard to onscreen keyboard [closed]

I have an assignment to create a GUI with a keyboard and text area. Conceptually, the user would type on the physical keyboard and the respective key would change background on screen to reflect that ...
2
votes
2answers
97 views

A very basic Java calculator that calculates only single digit numbers

How should I incorporate a JButton array, and how do I get rid of the multitude of action listeners? I would also like to modify it so that you can do more than one operation on numbers with multiple ...
1
vote
2answers
131 views

Simple Java MVC (swing)

I'm a Java beginner currently practising MVC pattern and came up with this. Could you please check if this is a proper implementation of MVC and if there are any best practices that I have broken? <...
1
vote
0answers
24 views

Cleanly preventing flashing an element from corrupting future flashes

For a Seesaw (Swing) app I'm writing, I need to be able to flash a component for a certain duration. Here's the basic function I came up with that accomplishes this: ...
3
votes
0answers
55 views

Swing framework removing cyclic dependency between UI and Controller

I am creating a Java Swing Application which deals with Geographic and Stellar data and I need a solid framework on which I can build (now) and extend (in future) any functionality I wish to. I am ...
3
votes
0answers
68 views

Game of Life in Java using Swing

As a hobby project I implemented Game of Life in Java using Swing. I don't have much experience with Java using Swing and would like to get feedback on the code. One thing in particular that I would ...
5
votes
2answers
375 views

Java Langton's Ant simulation

I have implemented a simulation which is called "Langton's Ant" with Java. Here is a short summary of basic rules: A ant is placed in a 2D matrix and looks to north, west, east or south. First, all ...
3
votes
1answer
835 views

Java Flappy Birds clone

I have implemented a little Flappy Bird clone with swing. I'm pretty new to Java, especially in graphic programming, so I'm really glad if someone an give me a feedback to my Code and maybe to ...
-8
votes
1answer
647 views

Java program to disturb user and waste SSD lifetime [closed]

This Program has three goals: Disturbing the user that accidentally run this by opening a lot of windows Creating a lot of files that waste the lifetime of SSD's Destroying Overview and waste time - ...
0
votes
0answers
46 views

JTable with action on double click an popup menu

I am using this code to add to a JTable an action on double click with mouse, and a popup menu: ...
3
votes
1answer
147 views

Updating the icon of every JLabel in a JLabel ArrayList

I want to update every icon of a JLabel ArrayList, to its own individual icon based off of an outside ...
3
votes
2answers
87 views

Generating a Lua script for a tile map maker

I'm using printwriter to generate a LUA script for a tile map maker. It seems hackish to me, but it works. Purposes are for allowing users to make their own maps for my game. Is there a better ...
1
vote
1answer
36 views

Display class containing a Canvas in a JFrame

I've been using this class for so long, I never thought about how terribly big and how bad it looks. Looking back on it, this class looks so out-of-date, and nothing explains itself; I want to get it ...
3
votes
2answers
162 views

Web browser in Swing with MVC

Follow up question to: Utilizing OOP when creating a web browser After I received help on the question above, I've created 3 classes for my Browser. ...
1
vote
1answer
246 views

Java Swing GUI editor with tools and scripts

I am creating project named MEdit (link). It's rather advanced text editor, which features: Syntax highlighting for around 91 languages. Is pretty well commented Is written in pure Java Possibility ...
-4
votes
1answer
606 views

Notepad implemented in Swing [closed]

Please give me suggestions for improving this. ...
5
votes
2answers
159 views

A small but expandable Exam system

I'm trying to practice OO design as well as OOP in Java so I've created an Exam system that tries to be Object Oriented and expandable. This is what I haven't learned from Java so far: Java 8, ...
0
votes
2answers
2k views

Java - Swing - Memory game (Colors)

I'm trying to make a first game. I would like to make memory game where you have to find a color matched field. I made: MemoryGame - JFrame where I added mainPanel. In mainPanel I added two another ...
4
votes
0answers
40 views

Sierpinski Carpet using Seesaw

I decided to write a Sierpinski Carpet generator. This has been something I wanted to try since watching the Coding Train this summer. A screenshot of it in action with some experimental coloring: ...
1
vote
1answer
3k views

Cookie Clicker in Java

This is my first graphical application I have made in my life (except HTML and Javascript-Applications, if that counts). It's a simple implementation of Cookie Clicker, the famous browser game. ...
1
vote
1answer
101 views

“Guess number” game Java Swing app

I have implemented a "Guess number game" using Swing. The idea is that the user enters a range and the program makes guesses of the number. This is the first time I'm implementing this kind of ...
4
votes
2answers
276 views

Swing application to compute the area and perimeter of shapes

I am a beginner programmer. How would you refactor this code to abide by good coding practices? As it stands the program has 4 classes and its aim is to compute the area and perimeter of a specific ...
5
votes
2answers
960 views

Pong game in Swing

I have made my version of the game pong in java. This is my first Java coding project. I was curious if my code adheres to good Java coding practices. Constructive criticism is appreciated. The main ...
8
votes
2answers
881 views

Detecting Tiles in Java

My program detects what tile is being clicked and prints it to the console ...
6
votes
2answers
384 views

Java algorithm to declutter rectangles

I've been working on an algorithm to declutter rectangles while keeping them as close as possible to their original location (and oriented the same way). It seems to work fine when I have less than 1,...
5
votes
1answer
2k views

Java Swing MVC implementation for login process

I'm new to MVC. I have made small implementation in Java Swing using MVC pattern. I want little help from you to check if the code is appropriate to MVC pattern or not. So here is my code: 1. ...
4
votes
3answers
307 views

Simulating a closed particle system in Java

I have this program that simulates a closed particle system. Closed in this context means that the sum of all energies is constant. My primary concern is code itself, yet I would like to hear comments ...
1
vote
4answers
69 views

Form a firstname.lastname@domain.se address, eliminating diacritics from a name

I'm an amateur programmer who just started learning programming, my school gave me an assignment to create code that reads a surname and lastname from an input dialog box and then to edit those name ...
4
votes
2answers
441 views

Directory JTree Performance

The purpose of this short program is to: Detect all accessible local drives and USB drives List all the accessible directories for each drive which do not require administrator privileges or are ...
3
votes
2answers
57 views

Comparing reports in different file formats

EDIT: Found an issue myself - the SwingWorkers were not printing the tasks in the same order. I fixed it feeding just one ...
4
votes
0answers
4k views

Simple MVC CRUD with JDBC

I would like to review my simple piece of code. I am beginner (I learn java for 1 year) and I would like to find out whether I am on good way. I have created simple MVC CRUD java app "ProductManager"....
1
vote
4answers
150 views

Find frequency of combinations in large data set

My concern is performance of the code. It takes way longer than I would like. I would be willing to give up some memory for higher performance. I have JTable with serial numbers in column1 and ...
1
vote
2answers
471 views

Battleship game - preliminary version

I created preliminary version of battleship game. For now it works that: The computer generates a new a board and our task is to find all ships. I emphasize that I didn't focus on looks. If anyone ...
1
vote
0answers
50 views

Modification suggestion for Simplification game

Sorry for any confusion but I could only came up with the name Simplification. This game displays a simplification problem and the user has to solve it using BODMAS rule. The user will get 1 minute to ...
4
votes
2answers
2k views

Counter GUI in Swing, updating the count in the background

I made a simple counter GUI for practice. The user presses a button to start the counter. The button click executes a SwingWorker task that updates a JLabel with ...
2
votes
2answers
2k views

Java Drawing House

Can anybody tell me if there is a better way code this? As an exercise I was supposed to draw a simple house, and this is the main body of the code I have only I feel it could be way better but can't ...