|
-
Mar 7th, 2008, 05:24 AM
#1
Thread Starter
PowerPoster
[RESOLVED] System tray/Task bar height
Hi all,
Is that anyone of you know how to find the height of the system tray or task bar.
Thanks.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
Mar 7th, 2008, 04:04 PM
#2
Re: System tray/Task bar height
I tried something really stupid but it worked 
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);
}
}
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|