Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl?
Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl? ...
Is there an equivalent to Java's Robot class (java.awt.Robot) for Perl? ...
We'd like a trace in our application logs of these exceptions - by default Java just outputs them to the console. ...
I am reading image files in Java using java.awt.Image img = Toolkit.getDefaultToolkit().createImage(filePath); On some systems this doesn't work, it instead throws an AWTError complaining about sun/awt/motif/MToolkit. How else can you create a java.awt.Image object from an image file? ...
I'm currently turning an array of pixel values (originally created with a java.awt.image.PixelGrabber object) into an Image object using the following code: public Image getImageFromArray(int[] pixels, int width, int height) { MemoryImageSource mis = new MemoryImageSource(width, height, pixels, 0, width); Toolkit tk = Toolkit.ge...
Is it possible to convert a com.vividsolutions.jts.geom.Geometry (or a subclass of it) into a class that implements java.awt.Shape? Which library/method can I use to achieve that goal? ...
What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog? ...
I'm trying to write a resolution selection dialog that pops up when a program first starts up. To prevent boring the user, I want to implement the fairly standard feature that you can turn off that dialog with a checkbox, but get it back by holding down the alt key at startup. Unfortunately, there is no obvious way to ask java whether a...
Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given some code that created a window with some text and a button that rotated through differ...
We have a Java Applet built using AWT. This applet lets you select pictures from your hard drive and upload them to a server. The applet includes a scrollable list of pictures, which works fine in Windows, Linux and Mac OS X 10.5. We launch this applet via Java Web Start or within a web page. Our applet does not behave properly in Mac ...
How is AWT implemented for Solaris? ie: What native libraries, if any, is it dependent on. ...
I have subclassed java.awt.Frame and have overridden the paint() method as I wish to draw the entire contents of the window manually. However, on the graphics object, (0,0) corresponds to the upper left hand corner of the window inside the title bar decoration, not the first drawable pixel. Can I determine the co-ordinate of the first ...
I have a Java Applet that uses AWT. In some (rare) circumstances, the platform does not refresh the screen properly. I can move or minimize/maximize the window and see that my applet refreshed properly. I am looking for code that will give me the fullest possible applet screen repaint, simulating the behaviour of a minimize/maximize. I...
I have a simple GUI component written in Java. The class draws an analog clock in a java.awt.canvas. This canvas is then contained in a JFrame - What I want to do is give the canvas a 3d "raised" effect - almost like adding a drop shadow to a photo. Is there a simple way to do this? ...
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 show the help text. ...
As a followup to my question about the java.awt.Component.getName() property, I'm wondering if there is a way of squirreling an arbitrary object somewhere in a Component, similar to the tag property in .NET? This would be really handy for any code that does work to a component but doesn't necessarily know what that component is. For ex...
I have this problem: The text "ABCD\r\nEFGHJ" loaded from a file is matched with java regex "EFGH". Matcher object of course says start of the matched string is in position 6. The matcher counts \r \n as two positions. I put the original text in a AWT TextArea Component and then call select(6,10) to highlight the area which was matched...
I'm trying to change the font in an AWT menu bar using MenuBar.setFont(). The call works for the menu bar's child menus, but the menu bar itself doesn't change font (I'm trying to make the font larger). Does anyone know whether this is possible to do? I'm using JRE 1.6 on Windows XP. Update: Changing the font does seem to work so long...
I am trying to write out a png file from a java.awt.image.BufferedImage. Everything works fine but the resulting png is a 32-bit file. Is there a way to make the png file be 8-bit? The image is grayscale, but I do need transparency as this is an overlay image. I am using java 6, and I would prefer to return an OutputStream so that I ...
I am creating a buffered image that is going to be a snapshot of a JComponent (via paint()) and rendered inside an ImageIcon. There are a large amount of types in the BufferedImage(int width, int height, int imageType) constructor, but which one should I use? I am sure that any of them would work, but which ones are better than the o...
Dendrogram is not a regular diagram. Should I use any component from javax.swing.* library, or just draw it with java.awt.Graphics? ...