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...
Cobaltic asked 30/1, 2009 at 4:1

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 ...
Mercymerdith asked 9/12, 2015 at 20:37

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...
Alvertaalves asked 6/1, 2009 at 15:23

3

Solved

Can someone explain me what is the use of super.paint(g) where, g is a Graphics variable in Applets or awt or swings or in Java. I have done research and found that it is used to override but what...
Kirkkirkcaldy asked 2/5, 2014 at 17:56

4

Solved

I want to draw in Java's Canvas but can't get it work because I don't know what I'm doing. Here's my simple code: import javax.swing.JFrame; import java.awt.Canvas; import java.awt.Graphics; impor...
Magistral asked 8/3, 2012 at 3:58

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...
Cachucha asked 14/11, 2014 at 5:7

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...
Cowles asked 29/12, 2010 at 13:23

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 ...
Ybarra asked 1/5, 2016 at 0:39

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

Icon bug = new ImageIcon( getClass().getResource( "bug1.png" ) ); ImageIcon bug = new ImageIcon( getClass().getResource( "bug1.png" ) ); What's the difference between these two? My book always us...
Alvarado asked 30/12, 2013 at 1:1

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...
Unpeg asked 1/11, 2010 at 15:27

5

Solved

How can I draw an outline around any text in AWT, something similar to this picture?
Aeri asked 4/4, 2012 at 17:8

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...
Hayott asked 25/11, 2015 at 22:15

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: ...
Funchal asked 23/12, 2015 at 17:55

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...
Padlock asked 18/12, 2015 at 15:24

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...
Cotto asked 31/3, 2010 at 11:17

1

Solved

How can I check whether a pressed key is printable or not in a key press event in java?
Grebe asked 26/11, 2015 at 17:18

© 2022 - 2024 — McMap. All rights reserved.