awt Questions
2
I am trying to find a way how to determine which libraries does Java require for Desktop API to work, specifically the BROWSE function. I read a few guides, bug reports and workarounds, but none of...
Revelatory asked 23/10, 2015 at 7:2
7
Solved
I would like to export the image in my JPanel to a vector graphics file so it can be edited and printed at a higher-than-screen resolution. Essentially I want its paint() function to be called with...
Illogicality asked 1/5, 2009 at 15:40
2
I am trying to create a rectangle in Java but only with awt package classes.
I can only click two points and the program must calculate the width and height and draw a rectangle between those exa...
4
Solved
I'm using java.awt.FileDialog to create a dialog for saving a file. The problem is that when I specify a suggested (default) file name, FileDialog strips its extension. Example:
import java.awt.*;...
Libre asked 28/2, 2011 at 16:18
1
Solved
I am developing a JavaFX application on Windows 8.1 64bit with 4GB of RAM with JDK version 8u45 64bit.
I want to capture part of the screen using Robot but the problem is that I can't get the scre...
2
1
I just want to draw the circle which is exactly 15x15 pixels sized, and have fill and outline. I'm using Java2D. The problem is, as a result of sequentally called Graphics2D.fill(circle) and Graphi...
2
I have a Java program taking 100% cpu, but seemingly doing nothing.
If I take a thread dump, there are 4 threads (out of a pool of 5) waiting to take a lock.
"Incoming WorkPool 5" - Thread t@363
...
Hysteria asked 14/4, 2015 at 13:21
3
Solved
I am learning Java and would really like to have a deeper understanding of what the ActionEvent e perameter means and stands for. When I code I don't just want to spit out lines that work, but I do...
Klehm asked 4/7, 2015 at 1:41
3
Solved
I have a JTextArea for which I have set word-wrap and wrap-style-word to true. I want to "pack" the JTextArea to the minimum possible height given a specified width.
To do this, I'm planning calcu...
1
Solved
How can I conver one to another? I thought a way via rgb string, but this case alpha layer is ignored. So the question - how to convert one to another with alpha?
2
Solved
I have created a dialog in which a user can browse for an image and then see a preview of the image drawn on a canvas. The image is scaled so that its aspect ratio is maintained while fitting in th...
Aesthetically asked 8/10, 2013 at 20:54
1
Solved
I have been trying to resolve this without success.
How to make JPanel p respect the defined GridLayout?
All I get is the first row containing 3 panels but not 4 as I've told Java to perform.
What...
Queston asked 17/4, 2015 at 22:2
1
Are there any changes than came with Swing and AWT in Java 8? In release notes for Java 8 I it's not mentioned.
1
I know that you can import a Font in Java with something like this:
File file = new File(fontPath);
Font font = Font.createFont(Font.TRUETYPE_FONT, file);
// alternative:
// Font font = Font.creat...
1
Solved
I did some Win32 GUI programming several years ago. Now I am using Java Swing.
Just out of curiosity, where is the Swing counterpart of Win32 message loop logic? In Win32, it is achieved with the ...
1
Solved
I know Swing use Java2d which extends AWT to draw on screen but, what low level toolkit is used by swing to render? GTK or QT for example?
3
Solved
The javadoc said:
For efficiency, programmers should call dispose when finished using a
Graphics object only if it was created directly from a component or
another Graphics object.
So in the...
3
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...
1
I'm trying to serialize a BufferedImage in Java, but running my program I received a NotSerializableException.
Looking at the BufferedImage class, I noticed that it does not implements Serializabl...
Amadus asked 10/3, 2015 at 0:18
3
I'm developing a fairly complex Java application mixing Swing and SWT. Whenever I start the application, this is the console output (and the app doesn't show up):
2012-12-19 12:45:45.359 java[3442...
3
Solved
I am developing a Swing application with a component performing custom painting. When I make some mistake in the painting code and an exception is thrown, the situation is hard to debug. Instead of...
Dishman asked 22/12, 2014 at 13:7
4
Solved
We'd like a trace in our application logs of these exceptions - by default Java just outputs them to the console.
1
I have a custom Icon which uses a TexturePaint as paint and calls fillPolygon on a Graphics2D object.
This code works fine on JDK6 and JDK7, but fails under JDK8 with 64bit Linux (tried most recen...
Gingivitis asked 29/10, 2014 at 13:44
2
Solved
After much looking, I found a bit of code that converts a BufferedImage to a SWT Image (don't bother reading it yet):
public static ImageData convertToSWT(BufferedImage bufferedImage) {
if (buffe...
Pup asked 27/6, 2011 at 20:20
© 2022 - 2024 — McMap. All rights reserved.