AWT: how to get the size of the titlebar in a Frame?


all,

I have encountered a problem that seems like it ought to have an easy fix, but I can't seem to find any info about it, anywhere.

My applet is restricted to using AWT with a target JVM version of 1.3.1. After a loading sequence, the applet creates a Frame and proceeds to add components to the frame according to a specific layout. No layout manager is being used. The problem is that if I try to add one of my custom components at (0, 0), it appears underneath the title bar of the Frame. This title bar varies in size depending on the browser that was used to launch the applet (and even depending on the theme which the browser is using). I need a way to get the (vertical) dimension of the titlebar so I can adjust my origin for custom drawing, but I can't seem to find any info whatsoever on how to do this in a platform-independent way.
Posted On: Tuesday 23rd of October 2012 10:56:18 PM Total Views:  59
View Complete with Replies

RELATED TOPICS OF Swing / AWT / SWT PROGRAMMING LANGUAGE




from list awt to JList swing

hi i have create program in awt...now i want create in swing...i have one problem i have this code in awt: int selectedIndex = getCurrentSelectedIndex2(); if(selectedIndex >= 0){ playerCTL.stop(); String selectedSong = getPlayList2().getItem(selectedIndex); SongVO sv= (SongVO)songMap.get(selectedSong);
VIEWS ON THIS POST

162

Posted on:

Thursday 20th September 2012
View Replies!

getScreenSize() method giving java.awt.HeadlessException

I am getting HeadlessException for getScreenSize() method.Please find the below sample code for more details. Dimension dim = null; try{ dim = Toolkit.getDefaultToolkit().getScreenSize(); }catch(Exception e){ e.printStackTrace(); } The getScreenSize() method is not working in Java 1.6.But it is working in 1.4. Recently we have upgraded the java to 1.6. Can you please help me on this issue |
VIEWS ON THIS POST

204

Posted on:

Tuesday 25th September 2012
View Replies!

java.awt.Robot

can anyone please suggest me with any source from where i can learn about Robot class in detail
VIEWS ON THIS POST

71

Posted on:

Friday 28th September 2012
View Replies!

java.awt.Graphics and java.awt.Graphics2D

Out of simple curiosity who implements the actual methods that draw Since the draw(Shape S) from the java.awt.Graphics2D is an abstract method and I heven't been able to find something that implements logic to it. I got curious!
VIEWS ON THIS POST

76

Posted on:

Saturday 29th September 2012
View Replies!

Problem relating existence of awt pacakage

Iam using jdk1.6. I compiled a code which has "import javax.awt.*;" line, but the problem is compiler says pacakage javax.awt does not exist. What can I do to resolve the problem.
VIEWS ON THIS POST

48

Posted on:

Saturday 29th September 2012
View Replies!

swing & awt: drawing based on pixels?

Hi all: This is a simplified question about some gui details in Java. The background design pattern is mvc. Assume that I need to draw a circle: public class MyCircle { // Please look at the data members private MyPoint center; // MyPoint is just a simple class representing a 2-D point (x,y) private int radius; private String color; // everything below are public methods that set/get values etc ... ... }
VIEWS ON THIS POST

66

Posted on:

Wednesday 17th October 2012
View Replies!

awt vs swings

why do we say that swings are light weight in nature and why was the swings introduced in java in spite of we had the awt.
VIEWS ON THIS POST

82

Posted on:

Wednesday 17th October 2012
View Replies!

awt colors

I'm looking for a color navy blue in Awt. I have seen the colors in AWT. java.awt.Color; But I want navy blue. How would I get it in AWT Can anyone please help me
VIEWS ON THIS POST

72

Posted on:

Wednesday 17th October 2012
View Replies!

dynamically filling of embedded swt_awt frame

hello all, i wrote a plug-in which displays a empty awt frame within an editor (org.eclipse.ui.editors) by using the SWT_AWT bridge. by the using of plugin: exists any way to get the embadded frame from my open editor i want to load dynamically any awt-frames from any java-project. is that possible for suggestions
VIEWS ON THIS POST

102

Posted on:

Wednesday 17th October 2012
View Replies!

How to set maxlength for java.awt.TextField

Could anyone let me know on how to set the maxlength for a field of type java.awt.TextField in Applet
VIEWS ON THIS POST

74

Posted on:

Wednesday 17th October 2012
View Replies!

Java.awt.Desktop

please give any example using java.awt.Desktop
VIEWS ON THIS POST

54

Posted on:

Wednesday 17th October 2012
View Replies!

java.awt.Robot

, I'm using the Robot class to send commands to windows to control the mouse and keyboard for work. Everything seems to be working fine but for the life of me I cannot send a Ctrl+Alt+Delete command to unlock my workstation so I can begin processing. Has anyone EVER done this before A simple sniplet of my code is below: roboCop.keyPress(KeyEvent.VK_CONTROL); roboCop.delay(500); roboCop.keyPress(KeyEvent.VK_ALT); roboCop.delay(500); roboCop.keyPress(KeyEvent.VK_DELETE); It seems like when keyPress(KeyEvent.VK_ALT) is called my previous command is released....I have divided this task up and was able to do control V to past and alt A to navigate my menu, but when I put the commands together they don't seem to work. Any suggestions would be appreciated.
VIEWS ON THIS POST

45

Posted on:

Thursday 18th October 2012
View Replies!

sql package in awt and swing

DEar In a program sql package was imported using--> import java.sql.*; import javax.swing.sql.*; what is the diff betn two, it works importing either package. rgs, santosh
VIEWS ON THIS POST

64

Posted on:

Thursday 18th October 2012
View Replies!

java.awt.GridLayout

"java.awt.GridLayout 1.0 Parameters: rows The number of rows in the grid columns The number of columns in the grid hgap The horizontal gap to use in pixels (negative values force an overlap) vgap The vertical gap to use in pixels (negative values force an overlap)" Core Java Vol 1 (8th Edition), Pg. 377 Do you have an example of where hgap and vgap might be applied
VIEWS ON THIS POST

50

Posted on:

Monday 22nd October 2012
View Replies!

awt alignment issue with japanese character

I am using japesenes OS(Win XP ) and running awt application (JDK1.6). For Choice box (dropdown box) ,if the font is less than 15 and if there is a mixture of japanese and number ,the numbers and the Japanese characters are not vertically aligned. I am using java.awt.Choice component to display all the months Choice month =new Choice(); month.insert ("1 \u6708", 0); month.insert ("2 \u6708", 1); month.insert ("3 \u6708", 2); .. so on While running the applet , in display window The numbers and the Japanese characters are not vertically aligned. When a month is selected, it is slightly truncated at the top. My default font is [family=SansSerif,name=sansserif,style=plain,size=12] when i change the font to 15,the characters are properly aligned. Did anyone faced this before if so can you please clarify why this behaviour when font size is less than 15 or how to resolve this issue without changing the font size .
VIEWS ON THIS POST

46

Posted on:

Monday 22nd October 2012
View Replies!

java.awt.headless - based on what is this System property set?

I'm running some tests, which include java GUIs, on a Linux compute farm. If the System property 'java.awt.headless' is set to true, then my tests fail with a HeadlessException - which is fair enough, because they genuinely display some GUI elements. Now, whether 'java.awt.headless' is set to true or not changes depending on how I submit my job to the compute farm. I guess that the details of my compute farm are off-topic and not that interesting for anyone else on here. But what I would like to know is how, in general, does the JVM decide how to set the property 'java.awt.headless' (on CentOS 4, if that makes a difference...) Does it check the DISPLAY environment variable Does it check to see whether it can connect to an X server Or am I missing the point and it is just up to the user to set this property when creating/setting up the JVM
VIEWS ON THIS POST

55

Posted on:

Monday 22nd October 2012
View Replies!

How to catch a awt. List adjusting

Writing AWT code (no swing allowed). I needed to know when the instance of awt.List is adjusted (i.e. scroll bar used). Is this possible or do I need to write my own scrolling list class [ October 31, 2008: Message edited by: an Sorenson ]
VIEWS ON THIS POST

38

Posted on:

Monday 22nd October 2012
View Replies!

java.awt.TextField - limiting input size?

Does anyone an AWT solution for how I can limit the input size of my java.awt.TextField so the user cannot enter more than 4 characters
VIEWS ON THIS POST

27

Posted on:

Monday 22nd October 2012
View Replies!

nothing shows. what did i forget?

import java.awt.*; import javax.swing.*; public class testPanel extends JFrame { JTextField text1; JLabel label1; JButton button1; JTextArea area; JScrollPane scroll; /** Creates a new instance of testPanel */ public testPanel() { Container flate = getContentPane(); // getContentPane is a method in JFrame JPanel p1 = new JPanel(new BorderLayout()); JPanel p2 = new JPanel(new GridLayout(2,2)); label1 = new JLabel("Label"); button1 = new JButton("Button"); text1 = new JTextField("Text"); area = new JTextArea(3,4); scroll = new JScrollPane(area); p1.add(label1, BorderLayout.NORTH); p1.add(scroll, BorderLayout.SOUTH); p2.add(button1); p2.add(text1); flate.add(p1, BorderLayout.WEST); flate.add(p2, BorderLayout.EAST); setVisible(true); setSize(400,400); } public static void main(String[] a) { new testPanel(); } }
VIEWS ON THIS POST

52

Posted on:

Tuesday 23rd October 2012
View Replies!

JScrool.getMaximum/getValue problem=

I need to get the maximum posible scrool position of a JScrollbar The getMaximum() simes to work fine! But the getVlaue is not as good. When i print out all the getvalues as soon as i move the scrool i have notice that when the scrool is in the top, the value is never 0, insted its 10-20 And when the Scrool bar is at the bottom it shold be the sam value that the getMaximum, but insted there can be a big diffrent, say Maximum = 5300 and the value at the buttom is about 4200-4600 \t Is there any way to get a more specified values for the scrollers position //SnowJim
VIEWS ON THIS POST

91

Posted on:

Tuesday 23rd October 2012
View Replies!