• 31.05.2026, 13:59
  • Register
  • Login
  • You are not logged in.

 

Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

CHECKER

Senior Member

Java Applets - always on top???

Thursday, August 21st 2003, 8:54pm

Hi leuts,

ich verwende Java Plug-in 1.3.1_07
und möchte halt in chats das dieses Java fenster - always on top ist... jedoch finde ich die einstellung dafür nicht...

Bin danke für jede Hilfe...

mfg. checker

Azr@el

Full Member

Re: Java Applets - always on top???

Thursday, August 21st 2003, 9:14pm

falls du code suchst guck ma unter a1javascripts.com
Jabber-ID: |Azrael|@jabber.ccc.org

CHECKER

Senior Member

Re: Java Applets - always on top???

Friday, August 22nd 2003, 12:57am

nee will eigentlich nur das was da oben steht...

Texx

Full Member

Re: Java Applets - always on top???

Friday, August 22nd 2003, 6:53pm

Entweder so:

Source code

1
2
3
4
5
6
7
8
9
10
11
addWindowListener(new WindowListener(){
      public void windowClosing(WindowEvent e){
            System.exit(0);
      }
      public void windowActivated(WindowEvent e) { }
      public void windowDeactivated(WindowEvent e) { toFront(); }
      public void windowDeiconified(WindowEvent e) { }
      public void windowClosed(WindowEvent e) { }
      public void windowIconified(WindowEvent e) { }
      public void windowOpened(WindowEvent e) { }
});


oder so:

Source code

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
/**
* Call this from class consructor
*/
public void initialize() {
TopThread top = new TopThread();
top.start();
}

/**
* Keep JWindow on top (inner class)
*/
class TopThread extends Thread {
public void run() {
while(true) {
toFront();
/**
* Let 10 milliseconds for other code to execute
*/
try {
Thread.sleep(10);
}
catch(Exception e) {
// Nothing to do
}
}
}
}


Achja, Google hab ich mit : "JWindow always on top" gefüttert und nur die letztere Lösung gefunden. Meine (die obere) funktioniert aber auch ohne Polling ganz gut.

gruß, Texx
We'll never stop living this way!