Other applets not repainting themselves?

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 396 Views - Last Post: 05 January 2012 - 05:47 AM Rate Topic: -----

#1 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Other applets not repainting themselves?

Posted 04 January 2012 - 07:32 AM

I have an issue where applets (not ones which I have made, but others found on the web) don't seem to repaint themselves, E.G. If you scroll down, the applet will go white and show parts of the html document. I also have a problem with eclipse, when I resize the appletviewer repeatedly, things don't draw where there supposed to (as in, pieces of the graphics are scattered everywhere) this example was a green circle.

[attachment=27220:Untitled.gif]

What confuses me is, the applets I have made don't do this. Is this maybe something to do with that applet being in java 7 and not java 6 like most would be?

This post has been edited by Mylo: 04 January 2012 - 08:10 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Other applets not repainting themselves?

#2 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2118
  • View blog
  • Posts: 8,823
  • Joined: 20-September 08

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 12:11 PM

Could be they're just buggy. Where are they? (We could maybe test them too)
Was This Post Helpful? 0
  • +
  • -

#3 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 09:42 PM

Here is some examples =)

http://tips4java.wor...nager-defaults/ (click the launch button)

Spoiler


http://docs.oracle.c...getStarted.html

Spoiler


zooming the webpage in and out makes no difference, but scrolling does, swapping tabs and then back to the applet tab will make it look normal again. Almost like its only painting on it's start() method. But its highly doubtful its a programming issue given it affects everything, and even renders webstart apps unusable.

Very annoying =)

However, if you go here

http://www.haydenjav...ome%20Page.html

You'll see in the background, (you can draw on it) that if you scroll up or down, nothing happens. That is in java 7 though, if it makes a difference.
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8032
  • View blog
  • Posts: 31,202
  • Joined: 06-March 08

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 09:54 PM

View PostMylo, on 04 January 2012 - 09:32 AM, said:

when I resize the appletviewer repeatedly, things don't draw where there supposed to (as in, pieces of the graphics are scattered everywhere) this example was a green circle.

That might be a false problem
In the real world Applet cannot be resized, thei size is determined by the .html file that displays them

Post your code
You can display all the .gif you want if we do not have the code that generates them....
Was This Post Helpful? 0
  • +
  • -

#5 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 10:06 PM

What happens in the case of zooming in/out of a webpage then, last time I tried, every stayed the same as they were in length of pixels. However, to make it percentage based, you could getWidth/Height(). Does that not count as resizing, maybe something else happens instead?

Here is a simple example which still gives effects similar to the first image. Ofcourse, this will have similar effects to the links posted above, since it's not being repainted by anything, only when the start() method is called, but even if it were to be repainted (which in my first post is) I still get the wierd graphical effects.

package MouseChaser;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JApplet;

public class MyClass extends JApplet
{

	@Override
	public void init()
	{
		
	}
	
	@Override
	public void start()
	{
		
	}
	
	@Override
	public void paint(Graphics g)
	{
		super.paint(g);
		g.setColor(Color.GREEN);
		g.fillOval(15, 15, 50, 50);
	}
	
}


Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8032
  • View blog
  • Posts: 31,202
  • Joined: 06-March 08

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 10:20 PM

Works perfectly in my AppletViewer
Was This Post Helpful? 0
  • +
  • -

#7 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8032
  • View blog
  • Posts: 31,202
  • Joined: 06-March 08

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 10:32 PM

tried also with a index.html file, it works in IExplorer
Was This Post Helpful? 0
  • +
  • -

#8 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 10:40 PM

I tried installing java 6, it kept deciding to use java 7 though. So I went to the java control panel -> java -> view tab (which doesn't paint itself either, just goes black when you mouse over it).

Then I uninstalled both, and installed java 6 again, now it cant find java webstart.

And I still have all the same problems :(
Was This Post Helpful? 0
  • +
  • -

#9 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8032
  • View blog
  • Posts: 31,202
  • Joined: 06-March 08

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 10:48 PM

Why would you need Java webstart to run an Applet ?
Was This Post Helpful? 0
  • +
  • -

#10 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Re: Other applets not repainting themselves?

Posted 04 January 2012 - 11:12 PM

The ones that use it from other websites I mean. Edit: I think you were referring to that it starts applications not applets =P but same problem anyway

This post has been edited by Mylo: 04 January 2012 - 11:16 PM

Was This Post Helpful? 0
  • +
  • -

#11 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2118
  • View blog
  • Posts: 8,823
  • Joined: 20-September 08

Re: Other applets not repainting themselves?

Posted 05 January 2012 - 03:51 AM

Quote

But its highly doubtful its a programming issue given it affects everything, and even renders webstart apps unusable.


True, plus the fact that both pbl and i don't seem to have any problems. Try ensuring you have the very latest graphics driver installed for your adapter
Was This Post Helpful? 0
  • +
  • -

#12 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Re: Other applets not repainting themselves?

Posted 05 January 2012 - 04:05 AM

Driver is up to date.

Not sure what else I can do, have uninstalled/reinstalled multiple times (even the jdk). I can't use the java control panel easily because of the same problem. I have cleared the java cache though. Problem is in both for IE and Firefox. Just what a hobbyist java programmer needs :)

Is there a way you can log what the JRE is doing?

This post has been edited by Mylo: 05 January 2012 - 04:07 AM

Was This Post Helpful? 0
  • +
  • -

#13 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2118
  • View blog
  • Posts: 8,823
  • Joined: 20-September 08

Re: Other applets not repainting themselves?

Posted 05 January 2012 - 04:09 AM

Are you noticing graphics problems outside the context of Java?
Was This Post Helpful? 0
  • +
  • -

#14 Mylo  Icon User is offline

  • D.I.C Addict

Reputation: 165
  • View blog
  • Posts: 587
  • Joined: 11-October 11

Re: Other applets not repainting themselves?

Posted 05 January 2012 - 04:16 AM

Nope, just applets, I think applications are fine (though I can't easily check for it). If it's of any help, Runescape works fine.
Was This Post Helpful? 0
  • +
  • -

#15 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2118
  • View blog
  • Posts: 8,823
  • Joined: 20-September 08

Re: Other applets not repainting themselves?

Posted 05 January 2012 - 05:17 AM

The Web Start examples are applications. You had difficulty with those did you not?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2