Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 2D / Re: [Check out] Rekursive drawing on: 2005-05-12 03:33:19
the applets are not working on my workstation. it seems that some classes for my workstation are not avaiable. which java version is needed?

error message:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
java.lang.ClassNotFoundException: main.ShapeMorpherApplet.class
      at sun.applet.AppletClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.applet.AppletClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.applet.AppletClassLoader.loadCode(Unknown Source)
      at sun.applet.AppletPanel.createApplet(Unknown Source)
      at sun.plugin.AppletViewer.createApplet(Unknown Source)
      at sun.applet.AppletPanel.runLoader(Unknown Source)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(Unknown Source)
      at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
      at java.net.PlainSocketImpl.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at sun.net.NetworkClient.doConnect(Unknown Source)
      at sun.plugin.net.protocol.http.HttpClient.doConnect(Unknown Source)
      at sun.net.www.http.HttpClient.openServer(Unknown Source)
      at sun.net.www.http.HttpClient$3.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.net.www.http.HttpClient.privilegedOpenServer(Unknown Source)
      at sun.net.www.http.HttpClient.openServer(Unknown Source)
      at sun.net.www.http.HttpClient.<init>(Unknown Source)
      at sun.net.www.http.HttpClient.<init>(Unknown Source)
      at sun.plugin.net.protocol.http.HttpClient.<init>(Unknown Source)
      at sun.plugin.net.protocol.http.HttpClient.New(Unknown Source)
      at sun.plugin.net.protocol.http.HttpURLConnection.createConnection(Unknown Source)
      at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
      at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
      at java.net.HttpURLConnection.getResponseCode(Unknown Source)
      at sun.applet.AppletClassLoader.getBytes(Unknown Source)
      at sun.applet.AppletClassLoader.access$100(Unknown Source)
      at sun.applet.AppletClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      ... 10 more
2  Java Game APIs & Engines / Java 2D / Re: JToolTip on: 2005-05-03 10:42:06
@Garage_Joe:

maybe you are right but maybe not, because if canvas should be marked as deprecated why there are thousands of experienced programmers which think that it is the best solution?
and if swing everything can do what awt does, why is it not thread-safe?

if you already implemented a canvas-like JPanel with a BufferStrategy and a Painting-Thread, i would be happy if you can give me some tips.
3  Java Game APIs & Engines / Java 2D / Re: JToolTip on: 2005-05-03 10:05:43
yes, the mixing of awt/swing is now my solution because there is no swing class which is capable to do the stuff i need but canvas does.

i have tried JInternalFrame but the repaint of the DesktopPane was to bad so i don't want to use it.

what do you mean with workarounds for tooltips and popups? this heavyweight things or is there more to do?

(in our company we are using a docking framework, too.
but i'm not the author) Wink
4  Java Game APIs & Engines / Java 2D / Re: JToolTip on: 2005-05-03 08:03:36
Thanks Lilian,

i know that i can override the paintComponent() function to draw my own stuff, but i am using a bufferstrategy and i think swing elements have their own buffering which is maybe not efficient enough for my purpose. and i am using a separate thread for painting and swing is known for beeing not thread-safe.
do you have any experiences with that?
Also thanks for saying how to switch the tooltips to heavyweight.

@orangy Tang:
i have searched before i posted here, but thanks for your great help.  Wink
5  Java Game APIs & Engines / Java 2D / Re: JToolTip on: 2005-05-03 07:13:29
because i want to paint some stuff dynamical.
how should i do this with a JPanel?

of course it will be easier if only
swing elements are working together, but sun says:
"which class has not a direct equivalent in Swing? -> Canvas!"
6  Java Game APIs & Engines / Java 2D / JToolTip on: 2005-05-03 05:53:09
Hello.

I'm using and AWT Canvas and a Swing JToolBar.
The ToolBar is over the Canvas.
The Problem is if you want to read the ToolTip of a Button in the ToolBar the ToolTip will be displayed behind the Canvas. How can i fix this?
menues have the option to set them heavyweight but ToolTips?
Any Ideas?
7  Java Game APIs & Engines / Java 2D / Re: maybe simple problem (translate) on: 2005-04-16 18:31:22
valodim was right.  Smiley
x,y changed during execution of paint().
i have fix it with storing x,y in temporary
variables at the beginning of paint() and
using the temporary variables for the painting.

now it looks like this:
public void paint(Graphics g){
 int tempX=TranslationX;
 int tempY=TranslationY;

 g2d.translate(-tempX,-tempY);
 // paint something
 g.translate(tempX,tempY);
}

Thanks
8  Java Game APIs & Engines / Java 2D / Re: maybe simple problem (translate) on: 2005-04-16 15:40:05
no, i'm only painting in the //painting area.
but in the future i want to scale the graphics
in the same way like translate. scaling only
works perfect but without the translate it
is senseless (i want to implement a mouse-zoom)
9  Java Game APIs & Engines / Java 2D / maybe simple problem (translate) on: 2005-04-15 13:42:00
hello,

i tried to translate this way:

public void paint(graphics g){
 g.translate(-x,-y)
 // paint something
 g.translate(x,y)
}

the first translate seems to work perfect but later the origin of the graphics is somewhere in the middle.

By the Way:
I'm changing x,y with a MouseListener and i'm using a thread for calling paint().

but why is the origin wrong? i'm translating and translating back so how can the origin change?

Greetz
10  Java Game APIs & Engines / Java 2D / Re: flickering canvas on: 2005-03-20 16:41:09
wow...i have tried it and it is absolute perfect.  Shocked
thanks for that great help.

1  
while (true) System.out.println( "WOW!!!!" );
11  Java Game APIs & Engines / Java 2D / Re: flickering canvas on: 2005-03-20 12:17:52
that seems not to be the problem.  Huh
the thread works but  the flickering is still there.

here the function of the threadclass:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
  public void run(){
    while(true){
      aCanvas.repaint();
      try { Thread.sleep(WaitMillis); } catch (Exception e) {}
    }
  }

 
  public void setWaitMillis(int millis){
    WaitMillis=millis;
  }


and the mouselistener:
1  
2  
3  
4  
5  
6  
7  
8  
  public void mousePressed(MouseEvent e) {
    // Coordinate calculations
   canvas.setWaitMillis(50); // delegates to the thread
 }

  public void mouseReleased(MouseEvent e) {
    canvas.setWaitMillis(500); // delegates to the thread
 }


canvas:
1  
2  
3  
4  
5  
6  
7  
8  
9  
  public void paint(Graphics g){
    gBS.clearRect(0, 0, width, height);

    //run through vector
      // draw element of vector

    // Draws the image to the screen.
   dblStrategy.show();
  }


12  Java Game APIs & Engines / Java 2D / Re: flickering canvas on: 2005-03-19 22:41:15
Okay,
the BufferStrategy works now but the Canvas is still flickering. Can it be that the drag-event is fired to often? is it common to use a seperate thread for painting the graphics?
13  Java Game APIs & Engines / Java 2D / Re: flickering canvas on: 2005-03-19 20:12:48
thanks Addictman,
that might be the problem.
i called createBufferStrategy(2) in the Constructor of the
Canvas-Subclass. Embarrassed
so i will try it again with the bufferstrategy.

thanks again.  Cheesy
14  Java Game APIs & Engines / Java 2D / Re: flickering canvas on: 2005-03-19 20:05:40
do you mean .setIgnoreRepaint(true) ?
yes i have set this, but i forgot to say that the mouse-listener calls on every drag-event .repaint() on this canvas.
do i need a special thread for calling .repaint()?
15  Java Game APIs & Engines / Java 2D / flickering canvas on: 2005-03-19 15:46:22
Hello,

i want to draw  in a canvas which listens to mouse events. so far so good, but if i get a drag-event the canvas begins with flickering. i have read about a bufferstrategy but i failed to use it with the canvas. the error message was something about "need a valid peer". so i am using a buffered image but the flickering is still there.
Here is the (pseudo-)code of the paint function of this canvas:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
  public void paint(Graphics g){
    Graphics2D g2 = (Graphics2D)g;

    if(firstTime){
      // create BufferedImage
     // create Graphics from BufferedImage
     firstTime = false;
    }

    //clear Image

    // run through vector
     // draw element of vector to Graphics of BufferedImage

    // Drawing the buffered image to the screen
   g2.drawImage(aBufferedImage, 0, 0, this);
  }


i would be happy if anyone has a hint for me.

thanks
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (22 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (26 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!