Questions tagged [awt]

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

The AWT is now part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program.

AWT is also the GUI toolkit for a number of Java ME profiles. For example, Connected Device Configuration profiles require Java runtimes on mobile telephones to support AWT.

http://en.wikipedia.org/wiki/Abstract_Window_Toolkit

6550 questions
2
votes
2 answers

AffineTransform.rotate() - how do I xlate, rotate, and scale at the same time?

I have the following code which does (the first part of) what I want drawing a chessboard with some pieces on it. Image pieceImage = getImage(currentPiece); int pieceHeight = pieceImage.getHeight(null); …
arcy
  • 12,845
  • 12
  • 58
  • 103
2
votes
0 answers

how to give job attributes from java.awt.JobAttributes to java.awt.print.Printable

I want to print. I am creating instance of graphics and printing. I am using the method java.awt.print.Printable.print(Graphics g, PageFormat pf, int page) . I don't want to show the print dialog, i have achieved this by not calling the…
Sar009
  • 2,166
  • 5
  • 29
  • 48
2
votes
1 answer

JFrame mouse click stopping keyboard buttons

My problem is when I click in the space of the frame screen it stops keyboard keys being registered so my player stop moving. Thanks in advance for the help. The code: private Component comp; .... public InputManager(Component comp) { this.comp…
DCSoft
  • 217
  • 1
  • 4
  • 17
2
votes
4 answers

Problems with swing components and awt events

I seem to be having problems with my java gui code, and I have no idea why it's not working. What needs to happen is when the mouse is clicked on the panel or frame - for now lets just say panel; as this is just a test eventually this code will be…
Victor
  • 5,697
  • 6
  • 34
  • 41
2
votes
1 answer

How do I consume a key event in Scala reactions

Suppose there is a "reactions" block such as this.reactions += { case KeyReleased(src, key, mod, _) => { // do some stuff // but how to consume this KeyEvent?? } } After doint "some stuff" I want to consume the KeyEvent, but I do not know…
2
votes
2 answers

Menu system works but cannot close

Okay, so I've got my menu system up and working from a JFrame. Everything seems to work really well, up until I click the button which starts a canvas. Now what the canvas does is intialize a JFrame which extends Canvas so I can't use a thread.…
Malii
  • 448
  • 6
  • 17
2
votes
2 answers

GridBagLayout being flagged as error

import javax.swing.JFrame; import javax.swing.SwingUtilities; >>>import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import javax.swing.JButton; import javax.swing.BorderFactory; public class GridBagLayout { public static void…
Dummy Derp
  • 237
  • 1
  • 3
  • 15
2
votes
1 answer

Java awt.print with Dot-matrix Printer

I use awt.print to write a print program which works well for a network connected Ink-jet Printer. When I run the program on a USB Dot-matrix Printer, it seems doesn't work.(the program can recognizes the printer) Can anyone tell me why. Here is…
Kaibin
  • 474
  • 2
  • 8
  • 18
2
votes
1 answer

Is that possible to grab pixels from AWT component?

I know that it is possible to capture lightweight Swing component picture by calling paint(Graphics g) method on the BufferedImage.getGraphics() instance. Like here: Swing: Obtain Image of JFrame Is it possible to grab AWT component's contents as…
Ostap Andrusiv
  • 4,827
  • 1
  • 35
  • 38
2
votes
2 answers

Popup on left click

I am trying to create a popup on a button through the action listener with Java. I have some code, but I can't get it to work, though I think I'm close! This code is from an example but for Pmenu.show, I had to remove the first arg, and I don't know…
Michael Scott
  • 429
  • 2
  • 8
  • 18
2
votes
1 answer

Is it bad practice to use swing and awt together?

If so why? What sort of conflict can come from this? I am trying to minimise the weird errors you can get in java by finding out what the best practices are so hopefully using them will keep me out of trouble! I have read a couple of swing vs awt…
Magpie
  • 607
  • 2
  • 7
  • 26
2
votes
1 answer

Swing Method error

I'm having a problem. I'm reading data from a socket, and when I read some meaningful data to my app I call a method to repaint the screen with the swing objects I want. This method works all right excepts that sometimes it does not appear. Nothing…
Pedro Neves
  • 364
  • 1
  • 8
  • 26
2
votes
4 answers

What causes a NullPointerException in the AWT-EventQueue-0 thread

I'm trying to do something to track down the problem, but there's not much I can do until paintContents, and everything there looks good through my debugger, but I'll double check to make sure I didn't miss anything. At the very least, I would like…
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
2
votes
2 answers

Java Hello World Desktop Application

I would like to see how to create a hello world java desktop application using Eclipse. I know Java very well, but I have never created a Java desktop application. It would be great if someone could provide an example. Thanks!
RagHaven
  • 4,156
  • 21
  • 72
  • 113
2
votes
0 answers

V-sync in windowed Java applications

I've been hacking on Notch's Ludum Dare 22 entry, Minicraft. It's a 2D action-adventure game written in Java. Although the game runs at 150-200 FPS on my laptop, there's very obvious screen tearing. I'd like to fix that. I have years of programming…
Adam Siler
  • 1,986
  • 5
  • 22
  • 26
1 2 3
99
100