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
2
votes
0answers
58 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
5k 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. ...
6
votes
2answers
939 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 ...
2
votes
3answers
2k 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 ...
3
votes
1answer
979 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 ...
2
votes
0answers
58 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 ...
1
vote
0answers
345 views

Notepad Clone Text Editor

...
1
vote
1answer
308 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 ...
7
votes
3answers
10k 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: ...
5
votes
2answers
216 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) ...
12
votes
2answers
269 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. ...
4
votes
1answer
6k 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: ...
1
vote
1answer
189 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 ...
5
votes
2answers
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 ...
8
votes
2answers
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 ...
6
votes
1answer
2k 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 ...
3
votes
1answer
85 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: ...
2
votes
1answer
447 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 ...
8
votes
1answer
233 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 ...
10
votes
4answers
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 ...
8
votes
2answers
42k 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 ...
13
votes
1answer
23k 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 <...
5
votes
3answers
4k views

Compute bounding rectangle given 2 points quickly and efficiently

Is there a faster way to compute the bounding area between 2 points? ...
0
votes
2answers
106 views

A whole bunch of JButtons

Please review this code. ...
6
votes
3answers
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 ...
5
votes
2answers
9k 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'...
2
votes
3answers
2k views

Game Of Life 3 in Java

I have this version of John Conway's Game Of Life in Java: Frame class: ...