I got it figued out. In the Controls class where I am creating the button I create the ActionListener:
btnClear.addActionListener(new Listeners().new btnClearListener());
And then in my...
Type: Posts; User: Krotus
I got it figued out. In the Controls class where I am creating the button I create the ActionListener:
btnClear.addActionListener(new Listeners().new btnClearListener());
And then in my...
I have a panel that an image is displayed in via a label. Clicking btnClear clears the image from the panel by removing the label. So the action listener code for btnClear works when it's in main. So...
So I've broken out my JFrame controls into their own class called Controls that extends the main class.
Now I'm trying to break out the Action Listeners into a Listeners class.
This code runs...
Well, that was pretty stupid.
I was trying to send the entire pixel matrix avgColor = ColorAveraging.ColorAverageByArray(clrAvgArray); from inside of the loop that was creating it:
/*Loop...
No, I did not use the toString method of the array. I used this:
System.out.println(ctr + " >>> " + clrAvgArray[ctr].getRed() + " : " + clrAvgArray[ctr].getGreen() + " : " +...
sumA += colors[i].getAlpha()
In the loop, as soon as i is 1, then that's where the exception occurs. So it gets the RGBA values from element [0] but as soon as it gets to element [1] it throws the...
I'm writing a simple blur effect and have run into a problem I can't figure out.
I have an array of colors and I want to get an RGBA average for each channel to color a pixel. Here is the code:
...
Yes, it is, thanks.
So I've changed the code to this:
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.imageio.ImageIO;
I've had a couple of Java courses for my CIS degree. Java I and Java II. Which doesn't mean much.
All of the examples I see for drawing on a JPanel show the paintComponent function inside of a...
Hello!
I'm a VB.net developer that is trying to learn Java. I am using IntelliJ on Windows 10.
Using Swing, I have created a simple JFrame with 2 buttons, Render and OK. There is also a JPanel...
I'm a VB.Net developer working on learning Java. I work a graveyard shift at call center and have a lot spare time. I can't install VS.Net so I got IntelliJ installed and am messing around with that....