Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the code:</p> <pre><code>img = new ImageEditor(); panel = new ImageEditor(); panel.setBounds(10, 11, 152, 151); panel.add(img); getContentPane().add(panel); </code></pre> <p>You are defining <code>img</code> as an <code>ImageEditor</code>, but you probably meant for it to be a <code>BufferedImage</code>. You are then adding it to <code>panel</code>, which is another <code>ImageEditor</code> - but it is being added through the superclass method <code>JPanel.add</code>, when you probably meant to use the method you wrote, <code>ImageEditor.setImage()</code>.</p> <p>EDIT: To summarize:</p> <p>The tiny block of updating pixels you described is the <code>BufferedImage</code> (<code>img.img</code>), inside of your <code>ImageEditor img</code>, which is in turn inside of the <code>ImageEditor panel</code>, which is itself inside the applet's content pane.</p> <ul> <li><p>replace <code>static ImageEditor img</code> in the <code>MainTest</code> class with <code>BufferedImage img</code></p></li> <li><p>replace <code>img = new ImageEditor</code> in <code>MainTest</code>'s no-args constructor with <code>img = new BufferedImage()</code></p></li> <li><p>replace <code>panel.add(img)</code> in <code>MainTest</code>'s no-args constructor with <code>panel.setImage(img)</code></p></li> <li><p>replace <code>static ImageEditor mock</code> in the <code>ThirdClass</code> class with <code>BufferedImage mock</code></p></li> <li><p>replace the <code>ImageEditor img</code> argument in <code>ThirdClass</code>'s constructor with <code>BufferedImage img</code> </p></li> <li><p>replace any other stuff involving <code>img</code> to correctly handle it as a <code>BufferedImage</code></p></li> </ul> <p>One other thing, although this problem isn't itself the cause of any program malfunction, you should rename the <code>Train()</code> method in <code>ThirdClass</code> to something like <code>train()</code> so it matches proper java style.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload