Stack Exchange Network

Stack Exchange network consists of 175 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
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [swing]

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

3
votes
0answers
67 views

Java game: select numbered tiles to form a goal sum

This is a homework project (Soft. Eng.) which I have completed. My teacher gave me a 91, but I am unhappy with this grade because my code is quite messy. (Please excuse incomplete Javadoc, the code is ...
3
votes
1answer
20 views

Mortgage calculator with Swing for Helsinki MOOC

New to Java, just finished the Helsinki MOOC course. I programmed a basic mortgage calculator as my first solo project and while it works, I have a few questions about coding style: The listener and ...
2
votes
2answers
60 views

Java Swing Exercise: BMI Calculator

This is my first question here and this is my working Body Mass Index Swing Calculator. Any improvement or recommendation is welcome. ...
2
votes
2answers
73 views

Minesweeper game in Java using Swing GUI

I created a Java Swing Minesweeper, for which I would like some feedback. Note : I'm just in high school so please excuse any 'dumb' ways I may have coded certain segments. Any tips or books on how ...
0
votes
0answers
50 views

Basic Connect Four Game [Follow Up 1]

Here is an updated version of a basic connect four game I had posted previously. Changes include: an overhauled validator, simplifying the process by knowing where the last move was made Utilized an ...
2
votes
0answers
83 views

Forest Fire Cellular Automata

I stumbled on the idea of a Forest Fire simulating cellular automata, and decided to try making a version using a full Seesaw UI (a Clojure wrapper over Java's Swing). A short sample of it running is ...
3
votes
3answers
117 views

Writing a calculator in idiomatic Java

I just dipped my toes in Java today (coming from C++) and made a few things to learn it. The standard stuff like Atari Breakout, Tic Tac Toe and this calculator. This has been done so many times ...
0
votes
0answers
16 views

Salesforce Live Agent Chat Client Code in Java

I have to use SwingWorker for the first time today, and I'm pretty pleased with the result. Would you mind helping check that I used it correctly? My class starts ...
-1
votes
3answers
80 views

A Java Calculator that could perform basic Mathematical Operations [closed]

I've been working for few days to develop a basic Java Swing Calculator that could Add, Subtract, Multiply or Divide two numbers and also has other options like inverse(1/x) and square root. But I am ...
1
vote
0answers
73 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
68 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
52 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
60 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
131 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
66 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
68 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
30 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
243 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
281 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
230 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
75 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
110 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
173 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
52 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
102 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
141 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
25 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
56 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
71 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
522 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
1k 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
666 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 - ...
3
votes
1answer
197 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
91 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
38 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
217 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
307 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
773 views

Notepad implemented in Swing [closed]

Please give me suggestions for improving this. ...
5
votes
2answers
173 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
42 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
4k 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
112 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
435 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
1k 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
894 views

Detecting Tiles in Java

My program detects what tile is being clicked and prints it to the console ...
6
votes
2answers
415 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
360 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 ...