Questions tagged [swing]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
120 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
536 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: ...
4
votes
0answers
853 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
87 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 ...
3
votes
1answer
471 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
1k 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 ...
4
votes
1answer
2k 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
918 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
135 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
180 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 ...
0
votes
1answer
1k 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 ...
1
vote
0answers
180 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
183 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
421 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
27 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
65 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
90 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
3answers
1k 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
4k 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 ...
-6
votes
1answer
812 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 - ...
4
votes
1answer
495 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
110 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
91 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
713 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
696 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
1k views

Notepad implemented in Swing [closed]

Please give me suggestions for improving this. ...
5
votes
2answers
204 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
6k 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
61 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: ...
2
votes
2answers
9k 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
160 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
1k 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
2k 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
925 views

Detecting Tiles in Java

My program detects what tile is being clicked and prints it to the console ...
6
votes
2answers
578 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,...
4
votes
1answer
3k 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
965 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
72 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
1k 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
71 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
8k 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
193 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
930 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
56 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 ...
5
votes
2answers
6k 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
7k 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 ...
3
votes
1answer
6k views

Simple Java Swing calculator for addition and subtraction

I have built a simple calculator using Swing that can perform two operations, addition and subtraction. I would like to extend the operations and add more functionality, such as multiply, divide, ...
5
votes
1answer
123 views

Swing “Number Guesser” program

I have made a UI that guesses the number that the user is thinking of(0 - 100), and I am wondering if it can be improved(I guess this is simple AI). I tried to shorten it as best I could, but it still ...
6
votes
1answer
466 views

Civilization Wars Game

I developed a mini game in Java Swing for the University; I'd like to carry it on as a personal project. But before that, I'd like to know if what I've done so far is correct or not. The game itself ...
2
votes
1answer
85 views

Create a GUI to update parameters of an Object

I have an Glob object which represents a glob of data. It has several parameters like size, the date it was created, who created it, and so on. I'm building a GUI ...

1
2
3 4 5
9