-
Began Watching Adding Multiple BufferedImages to one BufferedImage (Optimization)
I was wondering if it would be more efficient to render a single BufferedImage instead of rendering a bunch of BufferedImages in a double for loop? I have an idea … -
Created Trying to avoid AWT classes in Swing GUI
I'm used to using AWT's Canvas and BufferedImage and things like that. I've switched from using Canvas for drawing, to using a JPanel and I'm blown away by the efficiency. … -
Began Watching Trying to avoid AWT classes in Swing GUI
I'm used to using AWT's Canvas and BufferedImage and things like that. I've switched from using Canvas for drawing, to using a JPanel and I'm blown away by the efficiency. … -
Replied To a Post in Thoughts on the new DaniWeb Categories
@dtpp I have to strongly disagree, and if you just read what Dani wrote and if I understand correctly, DaniWeb has been around A LOT longer than SO. SO was … -
Replied To a Post in Thoughts on the new DaniWeb Categories
Whatever you want to call it, the point is that even though the tags are there for languages, people arent using them and are now resorting to posting the language … -
Gave Reputation to dtpp in Thoughts on the new DaniWeb Categories
Its not a forum anymore, its (another) clone of SO. At least for me...... -
Marked Solved Status for Properly using a Canvas [Java]
I know you're not supposed to use Lightweight Components like JFrame with non-Lightweight Components like JFrame, so my question is, what do you use with a Canvas? Is there also … -
Replied To a Post in Properly using a Canvas [Java]
Woaahh, okay. I think I definitely set this up correctly. I'm now getting an insane amount of frames (way more efficient than the other way)! About 8 million frames compared … -
Replied To a Post in Properly using a Canvas [Java]
I have successfully converted the code to use a JPanel instead of a Canvas, however, now I am having issues with it. I am now getting an offset when drawing, … -
Replied To a Post in Properly using a Canvas [Java]
Alright. How would I go about painting if I want to use a separate method for rendering, especially when used in a game loop? Here's my game loop for reference: … -
Replied To a Post in Properly using a Canvas [Java]
Drawing to a BufferStrategy, and having multiple buffers. Also, it's not a hassle to call repaint and revalidate :P -
Replied To a Post in Properly using a Canvas [Java]
I find it's more useful when Rendering in Games. -
Created Properly using a Canvas [Java]
I know you're not supposed to use Lightweight Components like JFrame with non-Lightweight Components like JFrame, so my question is, what do you use with a Canvas? Is there also … -
Began Watching Properly using a Canvas [Java]
I know you're not supposed to use Lightweight Components like JFrame with non-Lightweight Components like JFrame, so my question is, what do you use with a Canvas? Is there also … -
Replied To a Post in Thoughts on the new DaniWeb Categories
> There is the blue icon in the top right of every page for the dropdown navigation menu. Is this what you're referring to? I didn't even see this! Yes, … -
Created Thoughts on the new DaniWeb Categories
So I have a few concerns about the new Categories after a while of using them and I thought this would be the best way to express them. I have … -
Began Watching Thoughts on the new DaniWeb Categories
So I have a few concerns about the new Categories after a while of using them and I thought this would be the best way to express them. I have … -
Marked Solved Status for Java, Constructor that MUST EXPLICITLY call super
Is there a way to require a subclass to call super explicitly in it's constructor? -
Replied To a Post in Java, Constructor that MUST EXPLICITLY call super
@JamesCherrill I don't need to pass parameters @jwenting I actually didn't know this. I thought constructors worked like methods where you need to call super to call what happens in … -
Created Java, Constructor that MUST EXPLICITLY call super
Is there a way to require a subclass to call super explicitly in it's constructor? -
Began Watching Java, Constructor that MUST EXPLICITLY call super
Is there a way to require a subclass to call super explicitly in it's constructor? -
Created What does a Vector3 and Quaternion look like in code?
I'm looking for what exactly is a Vector3 (or any Vector for that matter) and also what a Quaternion is in code? What are the variables types? Should you have … -
Began Watching What does a Vector3 and Quaternion look like in code?
I'm looking for what exactly is a Vector3 (or any Vector for that matter) and also what a Quaternion is in code? What are the variables types? Should you have … -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
I'm honestly clueless as to how this error is even occurring. -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
Could it possibly be that I'm setting the sketchpanel to be the JFrames KeyListener, and also adding it as a component? -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
Gave that a shot, didn't help anything :/ -
Gave Reputation to JamesCherrill in JPanel repaints when Key is Pressed, but not when I call it directly?
No, sorry, can't see any problems their either. This is baffling! ps: I see you are defining local constrants to save typing `KeyEvent.` All the time Do you know about … -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
Here's the full SketchPanel class. package com.geodox.etch; import javax.swing.*; import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; /** * Panel which controls drawing and handles key events * * Created by GeoDoX … -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
Well, maybe it's an issue with adding it to the JFrame. Here's my application code that is called in the main method like this: `new Etch(1200, 800);` private Etch(int initWidth, … -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
Just a white background with the black pixel being drawn at it's correct coord's. -
Replied To a Post in JPanel repaints when Key is Pressed, but not when I call it directly?
Yup, I did. They were the correct values. I added some debug code for some output. Here's the new paintComponent(): @Override protected void paintComponent(Graphics g) { System.out.println("redrawRequested: " + redrawRequested); … -
Created JPanel repaints when Key is Pressed, but not when I call it directly?
I have a custom class which extends JPanel and overrides the paintComponent() method. Here's what that looks like: @Override protected void paintComponent(Graphics g) { if(redrawRequested) { g.setColor(ETCH_BACKGROUND_COLOR); g.fillRect(0, 0, owner.getAppWidth(), … -
Began Watching JPanel repaints when Key is Pressed, but not when I call it directly?
I have a custom class which extends JPanel and overrides the paintComponent() method. Here's what that looks like: @Override protected void paintComponent(Graphics g) { if(redrawRequested) { g.setColor(ETCH_BACKGROUND_COLOR); g.fillRect(0, 0, owner.getAppWidth(), … -
Began Watching Nested Loops?
Everytime I run this nested code, I just get stuck inside of an infinite loop.. any help? I'm not familiar with nested loops at all. I'm supposed to be getting: … -
Replied To a Post in Nested Loops?
I'm not sure why your code is even compiling as the less than sign should be on the left side of the equals sign. This should be how it is … -
Replied To a Post in Circular For Loop
And how do you get all the distances in a List? -
Replied To a Post in Circular For Loop
I don't just want the closest one. I want the list sorted into closest to furthest. -
Created Circular For Loop
I want to iterate over a List in a 2D way, basically starting at the center and working my way around in a "circular" fashion. The List is a List … -
Began Watching Circular For Loop
I want to iterate over a List in a 2D way, basically starting at the center and working my way around in a "circular" fashion. The List is a List … -
Marked Solved Status for WindowConstants' Constants, or JFrame's Constants?
I'm curious, when setting the default close operation for JFrames, should you use JFrame's constants or WindowConstants' constants? As far as I can tell they're the same. Although, IntelliJ (not … -
Created WindowConstants' Constants, or JFrame's Constants?
I'm curious, when setting the default close operation for JFrames, should you use JFrame's constants or WindowConstants' constants? As far as I can tell they're the same. Although, IntelliJ (not … -
Began Watching WindowConstants' Constants, or JFrame's Constants?
I'm curious, when setting the default close operation for JFrames, should you use JFrame's constants or WindowConstants' constants? As far as I can tell they're the same. Although, IntelliJ (not … -
Created Relying on Try-Catch enough to ensure the Process was successfully started?
Is this try catch block enough to ensure the process ran successfully? protected boolean attemptLaunch() { try { System.out.println("Attempting to open '" + name + "'."); //Try to open the … -
Began Watching Relying on Try-Catch enough to ensure the Process was successfully started?
Is this try catch block enough to ensure the process ran successfully? protected boolean attemptLaunch() { try { System.out.println("Attempting to open '" + name + "'."); //Try to open the … -
Replied To a Post in Apparently this isn't how to use a SpringLayout
Alright, I fixed that. However, still not sure what to do about the "pushing" the buttons over to the right. -
Replied To a Post in Apparently this isn't how to use a SpringLayout
I wanted something like the picture of the "Name Chooser" GUI only with a Vertical JList from [List Tutorial from Oracle](https://docs.oracle.com/javase/tutorial/uiswing/components/list.html). Not sure how to accomplish the layout of that … -
Replied To a Post in Apparently this isn't how to use a SpringLayout
Is there another Layout that I can use that would work? I'm not great with Layouts. I did try a GridBagLayout but it's not ideal. -
Created Apparently this isn't how to use a SpringLayout
So this is the first time using a Spring Layout and I gotta say, it honestly seems like a very nice Layout to use, but I can't quite seem to … -
Began Watching Apparently this isn't how to use a SpringLayout
So this is the first time using a Spring Layout and I gotta say, it honestly seems like a very nice Layout to use, but I can't quite seem to … -
Marked Solved Status for Should I use a LinkedHashMap for this?
I need a boolean to be stored with a String (or possibly a Path, not sure which one I want to use yet). I thought about using a Map, so …
The End.