Questions tagged [awt]

The Abstract Window Toolkit (AWT) is Java's original platform-independent windowing, graphics, and user-interface widget toolkit.

Filter by
Sorted by
Tagged with
1 vote
1 answer
276 views

Generate and Control JMenu Radio Buttons Using An Enum

Put together a RadioMenu class that can use a Enum to generate a Single-Selection Radio Button Menu. My main question is about whether there's a way to remove the ...
Tim Hunter's user avatar
1 vote
3 answers
393 views

Bank Account GUI

I've decided it would be best to break this project down into several parts. Consider this Part 1(GUI Design). I'm looking for help making 2 main improvements: Whenever I make a GUI, its always very ...
Grewal_Creator's user avatar
2 votes
0 answers
353 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 ...
legoMyEgo's user avatar
  • 167
2 votes
2 answers
13k 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. ...
Dexter Thorn's user avatar
  • 2,154
6 votes
2 answers
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 ...
CAD97's user avatar
  • 1,954
2 votes
3 answers
3k views

Drawing a star in AWT

I am new to java and graphics, and I am creating a java program that draws a star. It took me a few hours, but I finally have it drawing a star, but I am wondering if there is a better way to write ...
Brow's user avatar
  • 31
3 votes
1 answer
2k 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 ...
Newbie's user avatar
  • 700
3 votes
0 answers
65 views

GUI rogram connecting to SQL and listing information about products in specific category

This is my very first application written in Java and so I finalized it, solely because it occurred to be my thesis. It is a very simple program that lists categories (Northwind database is used as a ...
Edenia's user avatar
  • 1,548
1 vote
0 answers
433 views

Notepad Clone Text Editor

...
user avatar
1 vote
1 answer
386 views

Animate an oval shape using Thread

I have this project that should continuously animating using for loop. Also I want to include variations on the position where the ball pass through. Can anyone please check my code if I am following ...
Jay Gorio's user avatar
7 votes
3 answers
15k views

Creating a chess board

One of my assignments was to create a chessboard. In this assignment I could not use an array, or a form of list or what not. Below is my code for the creation of the chessboard: ...
R. Holland's user avatar
5 votes
2 answers
238 views

"I'm Listening"

For this next assignment, my job was to create a GUI with a button that changes text and color when clicked, and a slider that updates a label (with a TitledBorder) ...
syb0rg's user avatar
  • 21.8k
12 votes
2 answers
312 views

Custom drawString() for game development

About / Background This is indirectly a follow up from: General Game Loop 3.0, if you prefer to test against it, feel free to. That code is very outdated now though. A test suite is given at the end. ...
Emz's user avatar
  • 1,024
4 votes
1 answer
9k views

Java Dice Roller with GUI

Three days ago I wrote about a Java Dice Roller I wrote. I've now added a GUI to that program. Here it is: DiceRollerGUI.java: ...
user avatar
1 vote
1 answer
230 views

Calculation of image offsets for performing cropping

I am using the java.awt.Rectangle class to construct subsets of a GEOTIFF file. In order to do this I would need to specify the x,y offsets, height and width of ...
user avatar
5 votes
2 answers
5k views

Simple calculator in Java using Swing and AWT

I wrote a simple calculator with general operations. Give me please some advice, suggestions, and criticism about my code: code design, readability, mistakes. Calculator.java ...
DimaSan's user avatar
  • 185
9 votes
2 answers
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 ...
user3759462's user avatar
6 votes
1 answer
4k views

Finding the bounding box of a polygon array

I have a Polygon array, and I need to get a Rectangle object which bounds all of the polygons inside the array. Think convex ...
Constant's user avatar
  • 163
3 votes
1 answer
98 views

Simulating a GUI windowing system - follow-up

The previous and initial iteration at Simulating a GUI windowing system I have essentially cleaned the code based on the only answer. Now I have: MyCanvas.java: ...
coderodde's user avatar
  • 27k
2 votes
1 answer
506 views

Drawing own windows with AWT

I am trying to simulate a window system with java. I don't know much about Java graphic-APIs, so i began with AWT (I am using Graphics2D here, so far I don't need it, but I think it will come in handy ...
Sirac's user avatar
  • 335
8 votes
1 answer
264 views

Simulating a GUI windowing system

I was eager to learn the implementation details behind windowing GUI systems. Because I am mostly a high level programmer having not much experience in low-level stuff, I had to simulate it instead of ...
coderodde's user avatar
  • 27k
10 votes
4 answers
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 ...
Jamiex304's user avatar
  • 159
8 votes
2 answers
43k views

Basic Calculator using Java Swing and AWT

I created a basic desktop calculator using Java. Does anyone have any suggestions as far as coding best practices, readability issues, or just generic coding mistakes I might have missed? Any ...
Broomes's user avatar
  • 113
13 votes
1 answer
32k 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 <...
unableToCompile's user avatar
5 votes
3 answers
5k views

Compute bounding rectangle given 2 points quickly and efficiently

Is there a faster way to compute the bounding area between 2 points? ...
Mr. Polywhirl's user avatar
0 votes
2 answers
112 views

A whole bunch of JButtons

Please review this code. ...
Sajal Arora's user avatar
6 votes
3 answers
4k views

Shortening calculator project code

I was told to create a calculator design on AWT, which is also my first project on AWT. I wrote the program and submitted it. I was then told that my program contains around 70 lines of code, and I ...
Sajal Arora's user avatar
5 votes
2 answers
11k views

Splitting the GUI into smaller classes

I am currently working on a course project and have been assigned to write a GUI. I've written it and it's about 2000 lines of code. It will be bigger when I add the SQL codes and new panels. So, I'...
nihirus's user avatar
  • 53
2 votes
3 answers
2k views

Game Of Life 3 in Java

I have this version of John Conway's Game Of Life in Java: Frame class: ...
LazySloth13's user avatar
  • 1,301