Questions tagged [awt]

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

-1
votes
1answer
36 views

Detecting side of collision

I'm using awt and it's been working great. However, I need to detect the side that one object hits another. For a rectangle, it'd be a simple math, however for another shape (let's say text), it's not ...
-1
votes
1answer
28 views

Swing components automatically changes to AWT

I need to call the LOGIN page from the default class and work on it but when I call it, the Swing components in the next page changes to AWT.public class Demo {/*** @param args the ...
-1
votes
0answers
15 views

AWT Canvas - Drawing Arabic characters and words

I'm using a Java AWT Canvas to build an editor for the Arabic language.Since writing in the Arabic language goes from right to left. I have to change the current coordinate system of the canvas.So ...
1
vote
1answer
83 views

NullPointerException when calling method from another class

I am having a problem with a text-based game I'm making. I am fairly new to java and drawing GUI's in java, so I suspect my overall structure might be the root of the problem. So bear with me;My ...
0
votes
1answer
39 views

how to put a component at the center of other component that sit in a JPanel

I wondered how do I put a JLabel or a JPanel at the center of a JTable that Sit in a JPanel.I saw one example with BufferedImage but I could not convert it for some resone, here is the example link:...
0
votes
3answers
33 views

How to make a vertical line of buttons from the left side of the frame?

A frame which includes panels where buttons are located in a column on the left side of the frame:I tried to make this picture in real Java code but failed.I can't find the right solution for this ...
-2
votes
0answers
19 views

What is wrong in this code? (Using canvas in java, swing) [duplicate]

I have a main JFrame subclass with a bunch of items in it. Buttons, menus, etc.Then, I have a subclass of Canvas.The implementation of Canvas' subclass:class MiCanvas extends java.awt.Canvas {...
-2
votes
0answers
9 views

Layout for JButton, JSpinner, and Custom JPanel Window [duplicate]

I want to create the window shown in the image. I have a "public class MainFrame extends JFrame". I want to have two JButtons and one JSpinner at the top, and then have a custom JPanel at underneath. ...
1
vote
1answer
16 views

Custom JFrame class doesn't appear

This compiles fine but nothing is visible when it executes the code. What do I need to change?I've removed my Swing/AWT imports so I could post the question. The code is short and so is my question ...
-2
votes
0answers
14 views

How to add color to print in java [duplicate]

prokhorov, This is my program. A few tweaks in logic, I'll make after a while, but then I want to print this in Color.This is what I was talking about, I imported Graphics specifically for this post. ...
0
votes
0answers
20 views

Replacement of deprecated code(sun.awt.Win32GraphicsDevice)

So basically, I've come across some deprecated source code based on the sun.awt package. try {boolean bool=false;try {Field field=sun.awt.Win32GraphicsDevice.class....
1
vote
1answer
53 views

Java drawing moving rectangles in loop

I need to draw in AWT/Swing rectangles that are moving from frame to frame.I have a Playground classpublic Playground(int sizeX, int sizeY){frame=new JFrame();frame.setVisible(true);...
0
votes
0answers
14 views

Java: Disable duplicate keystrokes and getting two different keystrokes at the same time

I am designing a piano simulation software for educational purposes. When getting the user input I have to bind keys in the keyboard to pitches. There holding a key pressed for sometime results in ...
1
vote
1answer
46 views

Checking if a rectangle intersects text

I have a class called 'MapObject' which allows you to define what it is, what it does. I have recently added text to this, and it works fine however the collisions is a rectangle, which in some ...
1
vote
2answers
45 views

JButton Prints Multiple Times Instead of Once. Why?

I have a JButton and the code is below. When pressed it prints 3 times to the console instead of once. Why is it doing that and how to fix that? Thanks in advance! I also posted on code ranch....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,