awt Questions

1

Solved

I'm using a sprite sheet of sorts to load in spaceships. The documentation of Graphics.drawImage() states the arguments are boolean Graphics.drawImage(Image img, int dstx1, int dsty1, int dstx2, ...
Wadmal asked 5/6, 2014 at 14:48

3

I'm having trouble centering a JTexfield in my program.The Textfield does not appear aligned with the JButton. I've tried using the x.setHoriontalAlignment(JTextfield.CENTER); but to no avail. Any ...
Fathom asked 19/3, 2013 at 18:29

3

Solved

I want to make a round rectangle JTextField. I write a sub class of AbstractBorder to realize it.But I run into some problems. My requirement is: What I get is: My code is : import java.awt.B...
Subclass asked 28/5, 2014 at 6:58

1

I read that running AWT With JavaFX is a bad idea. But we have an old application that runs on Swing and uses the AWT canvas(Cannot change due to an external library that uses the canvas) Is it re...
Bianka asked 17/5, 2014 at 15:15

3

Solved

It's the original image: I use java.awt.Graphics.fillRect(int x, int y, int width, int height) to add a coloured rectangle on the image. Graphics imageGraphics = image.createGraphics(); Color colo...
Discord asked 17/5, 2014 at 8:7

1

I recently found out how to register a TTF font with the local GraphicsEnvironment, s.t., for my use case (SVG-to-PNG transcoding), Apache Batik may recognize the font: import java.awt.Font; impor...
Waring asked 7/5, 2014 at 16:46

2

Solved

I want to make a part of a JFrame transparent. It should look similar like OneNote Screen Clipper. I basically have a fullscreen overlay of a partially transparent JFrame and then inside this JFra...
Vet asked 8/5, 2014 at 12:16

3

Solved

Ive implemented the jFileChooser in my command line program and it works, just as it should with only one annoying issue. It seems that it opens underneath every window with no alert of any kind. I...
Louvre asked 21/9, 2011 at 4:6

3

Solved

I want to display a GameOver image in a pacman game after lives are over. But I call the paintGameOverScreen(Graphics g) and then I need to initialize g. Is there any other way to do this? This is...
Jerricajerrie asked 21/11, 2012 at 16:7

0

I'm using the area generation and drawing code from Smoothing a jagged path to create collision areas for tile sprites in a JRPG game I'm making in java - Its not a major full blown game, more just...
Etamine asked 16/3, 2014 at 2:9

2

Solved

I have been stock for a couple of hours now lol, not fun but this is why.. I have an app for typing which is to set the background of the button keyboard to a different colour lest say yellow (like...
Lida asked 15/3, 2014 at 0:8

2

Solved

I am working on a typing app which includes the a keyboard but I have found a bit hard to re-size the space button to make it wider than the other buttons.. This is the way I am displaying and orga...
Result asked 14/3, 2014 at 2:9

2

Solved

I am confused with the signature of SwingUtilities.invokeLater. It takes a Runnable object. Is it this Runnable object that is handed over to the Event Dispatch Thread? Why can't I directly call cr...
Albertinaalbertine asked 10/3, 2014 at 22:56

1

Solved

I have multiple places where I convert between one coordinate system and another. In each case there is a cosine/sine calculation between, let's call them x, y and x', y'. These are all JFormattedT...
Isodiametric asked 7/3, 2014 at 19:7

2

Solved

for my final year project I am developing an android app that can capture the image of a leaf and identify what type of tree it came from. I have a nearly completed PC version (developed in java) a...
Phyllotaxis asked 20/2, 2014 at 23:13

3

Solved

I'm still very new to java programming, so please help me to correct any mistakes I might have overlooked or give tips on how to improve this program. Okay, so a lot of problems have been solved, ...
Grim asked 6/2, 2014 at 1:51

1

Solved

New question was asked after this one, found here. I'm new to Java, but I am working on a recreation of "Flappy Bird" to learn more about java and the way that graphics are displayed. Any solution...
Helenahelene asked 5/2, 2014 at 20:37

6

Solved

I'm trying to add emphasis to one work in a string im drawing using swing. I was advised to use HTML with the following code: Graphics2D g2 = (Graphics2D) g; g.drawString("this is something I wa...
Hannahhannan asked 10/12, 2012 at 13:22

3

Solved

I'm creating a graphical front-end for a JBox2D simulation. The simulation runs incrementally, and in between the updates, the contents of the simulation are supposed to be drawn. Similar to a game...
Seismoscope asked 21/1, 2014 at 17:52

2

Solved

Question: What does calling setVisible(true) on a JFrame which is already visible do? I was digging through the source code of JFrame, and ultimately, it boils down to this function in Component w...
Seism asked 15/1, 2014 at 12:40

3

Solved

I have a Class extending JFrame that is watching for a mouse click anywhere: addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e){ System.out.println("mouse was clicked")...
Choriocarcinoma asked 3/9, 2010 at 19:12

1

Solved

The game I'm trying to create is snake and so far I've figured out how to use paint(Graphics g) a bit of JPanel, mouse listener and now I'm trying to create a rectangle that will move across the sc...
Faille asked 30/12, 2013 at 17:9

1

Solved

Inspired by Cannabis Equation from the Math site (it refers to the Wolfram Research Cannabis Curve) I was wondering.. How would we draw this curve using Java-2D?
Ashurbanipal asked 27/12, 2013 at 11:14

2

Solved

I'm using JNI to invoke a static java method which in turn creates a Swing JFrame and displays it. The code is fairly simple, and the Java-code is working standalone (i.e. java StartAWT does what i...
Keven asked 2/2, 2013 at 11:9

0

Runescape is a large online game with a pure-Java client which runs in the browser as a signed applet. It is pretty unique in that regard, with the other major example I know being Yohoho Puz...
Hilly asked 15/12, 2013 at 10:29

© 2022 - 2024 — McMap. All rights reserved.