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
26
votes
3 answers

How to use FileDialog?

I created an interface and I'd like to add a function that allows user to open a file. I'm using AWT. I don't understand how to use FileDialog. Can you please give me an example or a good link that explain this?
grb
  • 261
  • 1
  • 3
  • 3
26
votes
4 answers

Create GUI using Eclipse (Java)

Possible Duplicate: Best GUI designer for eclipse? Is there any Eclipse Plugin tool(s) who can help to create Graphical User Interface for (swing, awt or swt), because I'm tired of writing everytime the code of Panels, Labels, ... Thanks
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
26
votes
4 answers

jTable right-click popup menu

I have a SQL database and I am working on a program that will allow me to add/delete/modify records. I already managed to add records I am working on editing/deleting them. I want to display the existing records in a table so I am using jTable. I…
25
votes
3 answers

Safe to use Component.repaint() outside EDT?

I cannot find any official documentation saying that it is safe to call Component.repaint from another thread than the Event Dispatch Thread, the EDT. Is this so? And where can I find some documentation/code?
dacwe
  • 43,066
  • 12
  • 116
  • 140
25
votes
4 answers

NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager

when we migrated from Oracle JDK-8 to Open JDK-11, Apache POI excel generation has issues tried already -Djava.awt.headless=true org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is…
PCB
  • 638
  • 1
  • 11
  • 22
25
votes
1 answer

Collision detection with complex shapes

I am wanting to make a game that has each level loaded from an image. I want to draw up the whole level in Photoshop, and then set it as the background and allow the player to walk over it. I want another invisible image to go over top which will be…
calebmanley
  • 421
  • 1
  • 5
  • 16
25
votes
4 answers

How to rotate text with Graphics2D in Java?

I want to rotate text on a JPanel using Graphics2D.. My code is this: double paso=d.width/numeroBarras; double alto=datos[i].valor; Font fBarras=new Font("Serif", Font.PLAIN, 15); g2.setFont(fBarras); Rectangle2D…
Rafael Carrillo
  • 2,772
  • 9
  • 43
  • 64
24
votes
7 answers

Cannot load font in JRE 8

I cannot load a font from an S3 Inputstream in JRE 8. I do not have issue if a system is installed with JRE 7, JDK 7, or even JDK 8. val fontInputStream = s3Client.getObject(bucketName, objectKey).getObjectContent val customFont =…
Khanetor
  • 11,595
  • 8
  • 40
  • 76
24
votes
4 answers

Java and GUI - Where do ActionListeners belong according to MVC pattern?

I'm currently writing a template Java application and somehow, I'm not sure about where the ActionListeners belong if I wanted to cleanly follow the MVC pattern. The example is Swing based, but it's not about the framework but rather the basic…
jaySon
  • 795
  • 2
  • 7
  • 20
24
votes
4 answers

Apple Retina Display Support in Java JDK 1.7 for AWT / Swing

I just became aware that AWT / Swing under Java JDK 1.7 (as of JDK 7u15) does not support Retina displays on Apple Macbook Pros. Netbeans, for example, is nearly unbearable to use for more than a few minutes running on a Retina display and using…
kalefranz
  • 4,612
  • 2
  • 27
  • 42
23
votes
2 answers

Using awt with android

I have a Java Swing application which draws diagrams. It uses Graphics2D calls and awt objects such as Rectangle etc. At some point I might want to port this to Android. I understand that I can't use Graphics2D on Android, but can I still use the…
tomd
  • 239
  • 1
  • 2
  • 3
23
votes
9 answers

What is java.awt.Component.getName() and setName() used for?

What is java.awt.Component.getName() used for? It always seems to be null in the applications I build with NetBeans. I'm thinking of storing some help text per component in it -- I don't want to use the tooltip, I have another panel where I'll…
JohnnyLambada
  • 12,700
  • 11
  • 57
  • 61
22
votes
2 answers

AWT Window Close Listener/Event

I am sorry if this is a n00b question, but I have spent way too long for this once I create the Window listener, window event, and everything else, how do I specify what method to invoke? Here is my code: private static void mw() { Frame frm =…
alexmherrmann
  • 1,055
  • 2
  • 9
  • 17
22
votes
6 answers

If Swing is deprecated, what is the alternative?

I heard that apparently Swing is being developed no longer. I like Swing and use it all the time. What should I now be using instead?
Dean
  • 223
  • 1
  • 2
  • 4
22
votes
5 answers

Create an image from a non-visible AWT Component?

I'm trying to create an image (screen-shot) of a non-visible AWT component. I can't use the Robot classes' screen capture functionality because the component is not visible on the screen. Trying to use the following code: BufferedImage image = new…
Isaac Waller
  • 32,709
  • 29
  • 96
  • 107