Hi all,
Is that anyone of you know how to find the height of the system tray or task bar.
Thanks.
Printable View
Hi all,
Is that anyone of you know how to find the height of the system tray or task bar.
Thanks.
I tried something really stupid but it worked :D
Code:import java.awt.Toolkit;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.JFrame;
public class Util {
public static void main(String[] args) throws Exception {
int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
final JFrame tempFrame = new JFrame();
tempFrame.addFocusListener(new FocusListener() {
public void focusGained(FocusEvent e) {
tempFrame.dispose();
}
public void focusLost(FocusEvent e) {
}
});
tempFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
tempFrame.setVisible(true);
int frameHeight = tempFrame.getHeight();
int taskbarHeight = screenHeight - frameHeight;
System.out.println(taskbarHeight);
}
}