awt Questions
7
Solved
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 u...
4
Solved
This may be a stupid question, but I have to ask!
I have the following code snippets that are supposed to run their corresponding methods when the user interacts with objects.
For some reason, "fo...
Matchmark asked 31/3, 2010 at 11:37
1
Solved
I have the bad luck of suffering from a bug in java8,
that doesn't seem to be a big issue for anybody else, so Oracle is not going to fix it before java9.
The bug has Bug-ID 7172749 (also note the ...
2
I have a heavy java project which does not work responsive to the users. I have found out that long time needed events in event dispatch thread can cause my project to work slowly. So, I have two q...
Breakthrough asked 15/6, 2016 at 17:28
6
Solved
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[] pi...
Carob asked 24/9, 2008 at 0:0
3
Solved
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 weig...
3
Solved
4
Solved
2
Solved
Suppose I have a JPanel Called panel, and already with a paintComponent, I drew some shapes like rectangles. I can get a buffered image out of my panel like:
int w = panel.getWidth();
int h = pa...
3
Solved
I use PrinterJob.printDialog() to let the user select a printer and change various print settings.
However the dialog is always displayed using the standard Java coffeecup icon and not the one fr...
1
Solved
I want to create simple menu with difficult levels
Next few lines of code is constructor.
super();
setMinimumSize(new Dimension(600, 300));
setMaximumSize(new Dimension(600, 300));
setPrefer...
Hannibal asked 1/5, 2016 at 19:56
1
As you can see in the picture, the bars in the chart starts below the x-axis. How do I fix it so that it starts from the x-axis line? Please suggest me a fix and also I would be helpful to ...
3
Solved
When using the Graphics2D scale() function with two different parameters (scaling by different ratios in x- and y-direction), everything drawn later on this Graphics2D object is scaled too. This ha...
Beni asked 18/2, 2011 at 20:17
3
I implemented a sample class for a Virtual KeyBoard and ran this VirtualKeyboardTest.The keyboard appears but the main problem is that it is not closing properly when the x button is clicked.How ca...
Serriform asked 5/10, 2012 at 11:6
4
Solved
How can I get key combination of keys on keyboard E.G. (Ctrl+somekey, Alt+somekey) with Java?
I use KeyEvent listener, MouseEvent listener for all keys on keyboard. I can catch all key event on ke...
Disenfranchise asked 13/1, 2013 at 8:14
5
Solved
3
Is a listener available for java.awt.print.PrinterJob? I could only find PrintJobListener in javax.print.DocPrintJob. I am looking for its equivalent in java.awt.print.PrinterJob, so that I could t...
5
Solved
How can I draw an outline around any text in AWT, something similar to this picture?
4
Solved
I'm currently in the process of writing a paint program in java, designed to have flexible and comprehensive functionalities. It stemmed from my final project, that I wrote overnight the day before...
Lynnlynna asked 12/7, 2015 at 17:12
1
Solved
I am trying to make my program read the answers entered into a questionnaire-like form. For this purpose I plan to use getComponents() to get the answer fields I require (e.g. text fields, radio bu...
11
Now what I am doing in my program is that I am using setundecorated = true and MAXIMIZED_BOTH So it makes it go full screen and the display looks very nice, But the problem is that there are images...
Adenectomy asked 11/2, 2014 at 9:6
2
Solved
Is it possible to be notified whenever any window in the application was created or closed?
At the moment I'm polling Window.getWindows() but I would prefer to get notified instead.
What I have:
...
1
Solved
So, lets say I have some game, take Pong for example. Obviously, you generally speaking don't want to mix game-logic into graphics classes, so the class for Ball or Paddle is sepearte from the JPan...
5
Solved
I'm trying to set java.awt.headless=true during the application startup but it appears like I'm too late and the non-headless mode has already started:
static {
System.setProperty("java.awt.headl...
1
Solved
How can I check whether a pressed key is printable or not in a key press event in java?
© 2022 - 2024 — McMap. All rights reserved.