awt

"Always on Top" Windows with Java

In Java, is there a way to have a window that is "Always on top" regardless if the user switches focus to another application? I've searched the web, and all of the solutions lean to some sort of JNI interface with native bindings. Truly this can't be the only way to do it?.. or is it? ...

Howto bring a Java window to the front?

We have a Java-application that needs to be brought to the foreground when a telecontrol mechanism activates something in the application. In order to get this we have realised in the called method of the Class which represents the Frame of our application (extension of a JFrame) following implementation: setVisible(true); toFront(); ...

Disabling 'paste' in a jTextfield

Hi I have an app that is written in Swing, awt. I want to prevent users from pasting values into the textfields. is there any way to do this without using action listeners? ...

Detect whether FocusEvent of component is lost or gained

I implementing a EventQueue and get notified when AWTEvents are send. I wait till instances of FocusEvent are send to the dispatchEvent methode. The FocusEvent by itself does not have a methode to ask if the focus of the component is gained or lost. The methode paramString returns a String in which the information is placed, but i dont ...

Find composite location on screen

I am implementing a on screen keyboard in Java for SWT and AWT. One important thing is to move the keyboard to a position where the selected text field can show and is not lying behind the on screen keyboard. For AWT i can detect the position of the current selected component with Component owner = KeyboardFocusManager.getCurrentKeyboa...

What is this java.awt.event error?

ANSWER: If you ever see these lines and are mistified like I was, here's what they mean. Thread[AWT-EventQueue-0] (Suspended (exception NullPointerException)) EventDispatchTread.run() line: not available [local variables unavailable] It's not that the variables are unavailable because they are lurking behind a shroud of mystery in a ...

How to create a java.awt.Image from image data ?

How to create a java.awt.Image from image data? Image data is not pure RGB pixel data but encoded in jpeg/png format. JavaME has a simple api Image.createImage(...) for doing this. public static Image createImage(byte[] imageData, int imageOffset, int imageLength) image...

Is Google Web Toolkit similar to AWT and Swing

I've looked breifly into GWT and like the idea that I can develop in Java and have the application compile down to HTML and JavaScript. Is the concept behind GWT and AWT and Swing the same or different? ...

What is the difference between swing and awt?

Can some one please explain me what is the difference between swing and awt? Are there any cases where awt is more useful/ advised to use then swing or vice-versa? Thanks in advance. ...

swing components are light-weight ?

Whenever i read about swing they say they are light weight components.so i just googled swing and found that it means swing does not depend on native peers.Is that why they are called "light weight" ? I mean by light weight i thought maybe the swing components occupy less memory than the awt components.isnt that so ? ...

Java - Differences in AWT from 1.4 to 1.5 ( working on Unix and Windows )

Hi, This is with reference to my question: java.awt.HeadlessException Applets not displayed. There is a next question that has come up from the Sys Admins. They are asking - "Why does java1.5 now requires the explicit export DISPLAY in tomcat at all when java1.4 did not?" So what has changed in java1.5 which is causing it to throw ...

Canvas isn't resizing with window in Java?

I have a jFrame with a Canvas on it. When I run my program in Windows XP/Vista and resize the window the canvas resizes proportionately along with the window. However, in Ubuntu linux, when I compile the same java application and resize my window, the Canvas stays the same size. What do I need to do to make my Canvas resize with my wi...

Is it safe to construct Swing/AWT widgets NOT on the Event Dispatch Thread?

I've been integrating the Substance look and feel into my application and ran into several problems regarding it's internal EDT (Event Dispatch Thread) checking routines. Substance absolutely refuses to construct UI classes outside of the EDT. I've done plenty of Swing/AWT and I know most of the rules regarding the EDT. I use SwingWorker...

Fake X11 display?

I have a Java program using AWT which I would like to run on a headless system. The display for the program does nothing other than display stats. When the program finishes, it exits. There is no user interaction on the display. The program creates an output file which I use in my build system. Is there a way to get the Java program to ...

Is it possible to have a MouseMotionListener listen to all system mouse motion events?

My boilerplate listener: class MyMouseMotionListener implements MouseMotionListener { public void mouseDragged(MouseEvent e) { System.out.println("Dragged..."); } public void mouseMoved(MouseEvent e) { System.out.println("Moved..."); }} Simple enough, but what do I add it to in order to listen to system-wide events? I've been resea...

Fastest way to create a Java message dialog (swing/awt/other)?

I'm creating a Java application that will do some processing then needs to display a message to give the user feedback. However, it appears to be incredibly slow - taking over two seconds to return. I stripped the source down to the apparent culprit, and here is the code used: package SwingPlay; import javax.swing.JFrame; public cla...

Good source for AWT and Swing principles

Hi. I am starting to work with AWT and Swing in Java. I get some trouble sometimes, with things I don't understand. Latest example: JPanel.getGraphics() returns null in some cases. I would like a source where I can learn the principles and design of these API's, instead of just solving each problem at a time. Any recommendations? Tha...

Java's AWT or Swing for GUI construction?

I need to compose a fairly simple GUI for a server monitoring process. It will have a few tabs which lead to a log tailing, counts of resources, and a start and top control. Nothing fancy here. Which Java framework, AWT or Swing, makes more sense for something this simple. ...

Java Blob to Image

I have a blob data object which i can return from a database however i want to be able to use this on an awt application which is running on a PDA running J2ME. How would i do this? ...

Drawing a Translucent .png in AWT

I'm trying to draw a transparent.png image over a TV signal (so blending before rendering is kinda out). When I was drawing a transparent rect, I could just set SrcOver and specify an alpha for my background color and it would work: ((DVBGraphics) g).setDVBComposite(DVBAlphaComposite.SrcOver); But now I'm actually trying to use a png...