나는이 메인을 가지고있다. 실제로 스플래시 화면 인 부트는 항상 모든것 위에 있어야한다. 하지만 내 경우 엔 어떻게 될까요? main.main은 아무 것도없는 첫 번째 위치를 얻습니다. setAlwaysOnTop(true);
Java에서 문제를 일으키는 다른 프로세스가있는 곳에서 항상 Boot.java 클래스를 main으로 설정하는 방법은 무엇입니까?
main.Boot를 항상 맨 위에 설정할 수 있습니까?
Boot.java는 :
package main;
public class Boot
{
public static void main(String[] args)
{
try {
String myCmd;
// Layer 2 : it can be any other third party Java applications getting launched
// here its just one example used simple another JWindow...
myCmd = "java -cp /tmp/dist/AnotherProcess.jar main.main";
Runtime.getRuntime().exec(myCmd);
System.out.println("Running: " + myCmd);
} catch(Exception e) {
System.out.println(e);
}
myTimer(); // just a timer counting 40 seconds doing nothing else
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
private static void createAndShowGUI()
{
window = new JWindow();
....
//setFocusable(true);
window.pack();
window.setLayout(new BorderLayout());
window.setSize(screen.width, screen.height+1);
window.setLocationRelativeTo(null);
window.setAlwaysOnTop(true); // Layer 1
// (always on top) > but it gets behind
// what ever was launched using .exec(..)
window.setVisible(true);
}
}
OK - 내 main.main에'this.setBounds (0,0, screen.width, screen.height); '가있을 수 있습니까? 따라서 main.Boot setAlwaysontop 메소드를 덮어 씁니까? – YumYumYum
jWindow의 크기를 조정하려고 할 때 .setBounds와 setSize를 고소하는 동안 문제가 발생했습니다. 내가 .setBounds를 .setSize로 바꾼 이후부터는 크기 조절/스케일링을 할 수있었습니다. 어쩌면 그것이 문제 일 수 있습니다. 때문에 아이콘/터미널을 사용하여 내 동일한 응용 프로그램을 실행하기 때문에 완벽하게 작동합니다. 그러나 일부 비정상적인 시나리오에서 작동하지 않습니다. – YumYumYum
예 - 실제로 setBounds가 내 경우에 도청당했습니다. 그것의 해결. 고맙습니다! – YumYumYum