Search:

Type: Posts; User: Krotus

Search: Search took 0.10 seconds.

  1. Replies
    4
    Views
    1,678

    [SOLVED] Re: Creating a Listeners class

    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...
  2. Replies
    4
    Views
    1,678

    [SOLVED] Re: Creating a Listeners class

    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...
  3. Replies
    4
    Views
    1,678

    [SOLVED] Creating a Listeners class

    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...
  4. [SOLVED] Re: Passing an array as a parameter to a method - all elements after [0] generate an error.

    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...
  5. [SOLVED] Re: Passing an array as a parameter to a method - all elements after [0] generate an error.

    No, I did not use the toString method of the array. I used this:



    System.out.println(ctr + " >>> " + clrAvgArray[ctr].getRed() + " : " + clrAvgArray[ctr].getGreen() + " : " +...
  6. [SOLVED] Re: Passing an array as a parameter to a method - all elements after [0] generate an error.

    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...
  7. [SOLVED] Passing an array as a parameter to a method - all elements after [0] generate an error.

    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:
    ...
  8. [SOLVED] Re: How to click a button and have a line drawn on a panel in a frame.

    Yes, it is, thanks.
  9. [SOLVED] Re: How to click a button and have a line drawn on a panel in a frame.

    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;
  10. [SOLVED] Re: How to click a button and have a line drawn on a panel in a frame.

    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...
  11. [SOLVED] How to click a button and have a line drawn on a panel in a frame.

    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...
  12. Thread: Hi!

    by Krotus
    Replies
    0
    Views
    688

    Hi!

    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....
Results 1 to 12 of 12