awt Questions
3
Solved
I'm working on an application in which if a user clicks on a link, I want it to open in their default browser. From what I've read, this should in theory work, however, when run on Linux (specifica...
1
Whenever I try using the java.awt.Robot keyPress or keyRelease, it gives me the error message pid(25807)/euid(501) is calling TIS/TSM in non-main thread environment, ERROR : This is NOT allowed. Pl...
2
Solved
I would like to drag and drop using the Robot class in Java. For some reason the code below isn't working. Is there an alternative to this method?
public static void main (String args []){
Robot...
6
Solved
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?
Unreflecting asked 29/4, 2011 at 6:20
1
Solved
So I created a simple simple simulation where squares are spawned randomly with random vectors and bounce of the edges of the window.
I wanted it to take into account the window being resized. So ...
1
Solved
I have written a Java code to draw a polygon on an image. When I put my cursor inside the polygon it prints "Inside" otherwise "Outside". So the detection of the points inside the polygon is workin...
3
Solved
I am working on a project about remote control, send conrdinate x and y of cursor from client to server.
But
robot.mouseMove(x,y);
will only move the cursor to the particular point without mo...
4
Solved
In Java, is it possible to get the Width and Height of the JFrame without the title and other borders?
frame.getWidth() and frame.getHeight()1 seems to return the width including the border.
Than...
3
Solved
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 J...
Johannesburg asked 18/11, 2008 at 5:37
4
wondered if anyone could point me in the right directon, i have developed a pong game and it needs double buffering due to flickering. Iv tryed some of the post on here to try and make it work, but...
Killarney asked 14/1, 2010 at 11:0
0
Using Java 8 and AWT I'm displaying a tray icon on Windows 10. I also use the tray icon to display notifications. While displaying this notification, the mouse listener in the icon won't issue the ...
3
Solved
I've been trying and failing to use the java full screen mode on the primary display of an OSX system. Whatever I've tried I can't seem to get rid of the 'apple' menu bar from the top of the displa...
Genteelism asked 20/7, 2009 at 20:39
1
This is a simple code that just color the window 4 times.
Maybe there is something obvious that I don't see.
My goal is to learn computer graphic from scratch and I want to draw pixel by pixel ...
Fikes asked 21/4, 2018 at 13:24
5
Solved
I am a starting Java developer, learning just from internet tutorials. I am learning full-screen GUI applications. I was told yesterday that I shouldn't use AWT in my programs because it is outdate...
Ai asked 6/6, 2011 at 16:28
1
Using AWT, I would like to save resources like flash does, by stopping draws to the screen when the window is hidden. But first, I need a method to detect if the Frame is completely covered by one ...
4
Solved
I am currently trying to implement a keylistener in my program so that it does an action when I pressed an arrow key, the object in my program either moves left or right.
Here is the moving method...
Steersman asked 4/6, 2012 at 5:0
0
Lately our Java-FX application can't read Images from the clipboard anymore. For example the user selects a part of an Image in Microsofts-Paint and presses copy. I am not talking about copied imag...
5
Solved
In my application four TextArea is there and I want to enter only four character in one Text area and cursor automatically move to next TestArea. Again when I enter four character in this TextArea ...
3
Solved
I am surprised to see that getters of height and width members has return type double, albeit they are int. Moreover, setSize method with double parameters has the following definition:
/**
* Set...
6
Solved
I have trouble drawing a triangle with the draw(Graphics g) method in Java.
I can draw a rectangle like so:
public void draw(Graphics g) {
g.setColor(colorFill);
g.fillRect(p.x, p.y, width, heig...
Tango asked 12/8, 2012 at 4:9
4
Solved
As per this previous link (How to send keyboard outputs) Java can simulate a key being pressed using the Robot class. However, how could a combination of key presses be simulated? If I wanted to se...
5
I want to set the user's clipboard to a string in a Java console application. Any ideas?
4
Solved
AWT's TrayIcon class has a method called displayMessage that shows a native OS message that in Windows 10 looks like this:
when called like this:
Image image = Toolkit.getDefaultToolkit().getIm...
Daddy asked 12/12, 2017 at 1:56
6
Solved
I am having trouble reading an image. If I do the following
URL url = new URL("http://tctechcrunch2011.files.wordpress.com/2012/10/gmm.jpg");
ImageInputStream stream = ImageIO.createImageInputStr...
4
In Java we can create a Font object as such:
new Font("Helvetica", Font.PLAIN, 12);
My question is how do we get the entire list of font names from Java, for example "Helvetica" which we can use...
© 2022 - 2024 — McMap. All rights reserved.