What is the Java equivalent to Windows SystemMetrics?

Hello,
I would like to retrieve component metrics on items such as titlebar height, horizontal scrollbar height, default font etc.
Unfortunately, I want to know the information without neccessarily having an instance of the control type visible (ie I want to know how high my forms titlebar will be before I create the form).
The reason I need this is to feed information back to a third party product that requires the type of details that you could query from the SystemMetrics available in Windows.
The tricky part is that the windows app needs to know these details before the Java app has created its first form.
Any help would be much appreciated,
thankyou, Sean.

thankyou camickr,
that link was very useful - please have the dukes.
one thing that the link code doesn't give details about is how to find the metrics on the top level containers. Do you have any suggestions?

Similar Messages

  • What is the java equivalent to #define

    Hi,
    What would this declaration be in java:
    #define     STRAIGHT_FLUSH     1
    Many thanks, Ron

    There is no direct equivalent. As mentioned, enums can be used to fill one of #define's roles. (enumerated values)
    public static final constant member variables can fulfill another. (named constants)
    And actually, if I understand correctly, #define is not part of the C language per se, but belongs in the realm of the preprocessor, and you can run Java code through a c preprocessor.
    EDIT: Yeah, you can:
    :; cat X.java
    #define blah int
    public class X {
      Y y;
      blah x;
    jeff@shiro:/tmp 14:33:34
    :; cpp -P !$
    cpp -P X.java
    public class X {
      Y y;
      int x;
    }Message was edited by:
    jverd

  • What's the Java equivalent of a .dll file?

    If any?

    Actually, DLL for Windows. Where as in java,
    It's doesn't dynamically link.
    It's some what like Reflection classes.

  • What's the Mac equivalent of Windows Print Setup?

    I can't find where in OS 10.8.5 applications like Numbers or Pages to set margins, page orientation (portrait/landscape), etc. as in Windows Page Setup facility. I also can't find where to set printing in color or B&W.

    The choice of color vs B/W and single sided vs duplex printing is all found in the print dialog -- exactly where in the print dialog is determined by the author of the printer driver software, but it will be in one of the drop down menus in that dialog. In Apple applications such as Pages and Numbers the page setup is found in the File menu or you can access it directly with Shift+Command+P. Margins can be set by going to the View menu and selecting the option to Show Rulers or you can click on the appropriate section of the Inspector pane on the right hand side of the Window. The Pages or Numbers Help section has a lot of tutorial material that will walk you through most of what you need to know.

  • What is the Java equivalent of Visual BAsic ASC() and MID() functions

    Hello all! I just would like to ask if you have any idea on how to convert the VB ASC() and MID() functions into java. Where:
    1. ASC( ) Function - Returns the ANSI value for the leftmost character in a character expression.
    2. MID() Function - The Mid method extracts a substring of length nCount characters from a CHString string, starting at position nFirst (zero-based). The method returns a copy of the extracted substring.
    I would really appreciate your help. Thanx!

    ah yeah! sorry typo error. see, I am converting a VB method that encrypts password:
    Function EncryptText(ByVal stDecryptedText As String)
    Dim stText As String, lngCounter As Long
    Dim iTemp As Integer, lngNumber As Long
    lngCounter = 1
    lngNumber = 8
    Do Until lngCounter = Len(stDecryptedText) + 1
    iTemp = Asc(Mid(stDecryptedText, lngCounter, 1))
    If lngCounter Mod 2 = 0 Then
    iTemp = iTemp - lngNumber
    Else
    iTemp = iTemp + lngNumber
    End If
    iTemp = iTemp Xor (10 - lngNumber)
    stText = stText & Chr$(iTemp)
    lngCounter = lngCounter + 1
    Loop
    EncryptText = stText
    End Function
    I converted this function into this:
    public static String encryptPass(String password) {
    String encpwd = "";
    int iTemp = 0;
    final int lngNumber = 8;
    String stText = "";
    for ( int i = 0; i < password.length() ; i++ ) {
         iTemp = Character.getNumericValue(password.charAt(i));
         if ( i % 2 == 0 ) {
         iTemp = iTemp - lngNumber;
         } else {
         iTemp = iTemp + lngNumber;
         iTemp = iTemp ^ (10 - lngNumber);
         char c = Character.forDigit(iTemp,Character.MAX_RADIX);
         encpwd = encpwd + String.valueOf(c);
         return encpwd;
    But I'm having trouble with the encryption because it returns a different set of characters. Did I convert it right? thanx.

  • What is the Firefox equivalent of Windows' %username%?

    I'm trying to setup username variables in about:config, notably default download location and browser.cache.disk.parent_directory . When I use the standard %username% variable in these settings, Firefox interprets them literally. Does Firefox have an equivalent %username% variable?
    == This happened ==
    Every time Firefox opened
    == Always

    An extension should be able to do that quite easily.<br />
    Try this code in the Tools Error Console.<br />
    You can create an extension to make the change.
    <pre><nowiki>const Cc = Components.classes, Ci = Components.interfaces;
    var PB = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).getBranch("");
    var PN = "browser.cache.disk.parent_directory";
    var curVal = PB.getCharPref(PN);
    var userName = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment).get('USERNAME');
    newVal = curVal.replace(/%USERNAME%/i, userName);
    PB.setCharPref(PN, newVal);
    </nowiki></pre>
    See also:
    * https://developer.mozilla.org/en/nsIPrefBranch
    * https://developer.mozilla.org/en/NsIEnvironment

  • What is the Java equivalent to sapcpe

    After upgrading to ECC6 EHP5 I find none of my dialog servers have the updated jar files or bootstrap.properties file in the j2ee\cluster\bootstrap folder.
    How do jar files get copied from from server to another

    Hi,
    Please refer this link for more information on how sapcpe works.
    http://help.sap.com/saphelp_nwpi711/helpdata/en/27/44f17a26a74a8abfd202c4f5dc9a0f/content.htm
    Also refer this link
    http://al-infotech.com/news/2006/12/30/use-sapcpe-for-kernel-update-on-netweaver-2004-as-java-by-yu-nong-zhang-sap/
    I hope this clarifies.
    Regards,
    Naveen.

  • What is the Java runtime version required for SAP GUI 6.20 for Windows?

    Hi All,
    I need the following information:
    1.       What is the Java Runtime version required for SAP GUI version 6.2 for Windows (Platform Windows XP)?
    2.       And is there any problem if we use Java runtime version 1.6 on PC?
    It would be great if anybody can provide the information on the above.

    To run SAP GUI for WIndows -- Java isnt a pre-requisite nor is there any dependency for the same.
    Thanks,
    GLM

  • What is the mac equivalent to a right clic on a windows machine

    What is the Mac equivalent to a right click?  I installed Office for Mac 2011 on my macbook pro and I need to right click over a file from an ealier version of Office to make Office 2011 the default version of office.  This is all in preparation to install Lion (Lion won't support Office 2004 and I can't afford to lose access to these files).

    CTRL+click
    CTRL=control (in between the fn and alt/option keys).
    You can also go into System Preferences --> Trackpad and ensure "Secondary Click" is checked so that a two finger tap will act as a "right-click."

  • What is the WinRT equivalent of MediaPlayerLauncher

    WP8 has MediaPlayerLauncher, so what is the WinRT equivalent of MediaPlayerLauncher for WP8.1?
    Hong

    Thanks, Rob. That is what I was looking for. This is a universal apps project. I tested this with the Windows version and it launched the default video player as expected.
    Hong

  • I wonder to know what is the enterprise solution for windows and application event log management and analyzer

    Hi
    I wonder to know what is the enterprise solution for windows and application event log management and analyzer.
    I have recently research and find two application that seems to be profession ,1-manageengine eventlog analyzer, 2- Solarwinds LEM(Solarwind Log & Event Manager).
    I Want to know the point of view of Microsoft expert and give me their experience and solutions.
    thanks in advance.

    Consider MS System Center 2012.
    Rgds

  • What is the earliest version of Windows that you support.  I tried to download a trial of Photoshop and XP is no longer supported.

    What is the earliest version of Windows supprted?

    You're welcome.  For more detail, see:  System requirements | Photoshop
    -Noel

  • What are the java components?

    hi iam new to this it field. this is the question asked by interviewer. so please help me.
    what are the java components you can use in a webproject? how you use those components in your project?

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

  • What is the difference between Constant Window, Variable Window,Main Window

    hello all
    what is the difference between 1) Constant Window
                                                2) Variable Window
                                                3) Main Window   in SAP SCRIPT

    Hi,
    Window Types
    When defining a form window, you must select a window type for the window.
    You can choose between three types:
    Constant Windows (CONST)
    Variable Windows (VAR)
    Main Windows (MAIN)
    Constant Windows (CONST)
    Starting with Release 4.0, the system internally processes windows of type CONST similar to windows of type VAR.
    Therefore, if you create a new window, always use type VAR.
    Variable Windows (VAR) 
    The contents of variable windows is processed again for each page, on which the window appears.
    The system outputs only as much text as fits into the window. Text exceeding the window size is truncated;
    the system does not trigger a page break. Unlike constant windows, the page windows declared as variable windows may have different sizes on different form pages.
    As far as the processing of the window contents is concerned, the system currently treats constant and variable windows alike.
    The only difference is that constant windows have the same size throughout the form.
    Main Windows (MAIN) 
    Each form must have one window of type MAIN. Such a window is called the main window of the form.
    For SAPscript forms, the main window has a central meaning:
    It controls the page break.
    It contains the text body that may cover several pages.
    It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
    As soon as a window of type MAIN is full, SAPscript automatically triggers a page break and continues to
    output the remaining text in the main window of the subsequent page. Page windows of type MAIN have the same width throughout the form.
    The SAPscript composer thus avoids reformatting of the text after each page break.
    If a page does not have a main window, the system implicitly processes all other windows of the page and continues with the subsequent page.
    This page must not call itself as subsequent page (recursive call), since this would produce an endless loop.
    In such a case, SAPscript terminates the output after three subsequent pages.
    For printing header lines or totals, the different output areas of the main window are of special importance.
    go through this links:
    In Scripts Variable window and constant wind difference?
    Main Window
    Re: Main Window in SAP Script
    What is the difference between Constant window and variable window?
    Regards
    Adil

  • What is the Oracle equivalent of the Microsoft Access FIRST function?

    Using: Oracle 10gR2 RAC on SUSE Linux 9 (10.2.0.3)
    In the process of converting a Microsoft Access database to Oracle, an Access query is using the FIRST function.
    What is the Oracle equivalent of the Microsoft Access FIRST function?
    In the attempt to convert, the Oracle FIRST_VALUE function was used. However, the same results was not achieved.
    Thanks,
    (BLL)
    Query:
    h2. ACCESS:
    SELECT
         TRE.GCUSNO,
         UCASE([DCUSNO]) AS DCUSNO_STD,
         *FIRST(UCASE([DNAME])) AS DNAME_STD*,
         *FIRST(UCASE([DADDR])) AS DADDR_STD*,
         *FIRST(UCASE([DCITY])) AS DCITY_STD*,
         TRE.DSTATE,
         FIRST(TRE.DZIP) AS DZIP,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT
    FROM
         TRE
    GROUP BY
         TRE.GCUSNO,
         UCASE([DCUSNO]),
         TRE.DSTATE,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT;
    h2. ORACLE:
    SELECT DISTINCT
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)) AS DCUSNO_STD,
    UPPER(TRIM(TRE.DNAME)) AS DNAME_STD,
    UPPER(TRIM(TRE.DADDR)) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DNAME)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DNAME_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DADDR)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DCITY)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DCITY_STD,
    TRE.DSTATE,
    TRE.DZIP,
    FIRST_VALUE(UPPER(TRIM(TRE.DZIP)) IGNORE NULLS) OVER (ORDER BY TRE.DZIP ASC) AS DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT
    FROM CRM.TREUP100R TRE
    GROUP BY
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)),
    TRE.DNAME,
    TRE.DADDR,
    TRE.DCITY,
    TRE.DSTATE,
    TRE.DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT;

    A slight correction to odie's post. I think you want min not max to replicate the Access first function, but see below to be sure. So:
    min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
    user10860953 wrote:How does one ignore null values?The min and max functions will ignore nulls automatically, so if there is a null value in tre.dname, it will not be be returned, unless all of the values are null. For example:
    SQL> WITH t AS (
      2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
      3     SELECT 37, 'DEFG' FROM dual UNION ALL
      4     SELECT 65, 'DEFG' FROM dual UNION ALL
      5     SELECT 65, null FROM dual UNION ALL
      6     SELECT 70, null FROM dual UNION ALL
      7     SELECT 70, null FROM dual UNION ALL
      8     SELECT 37, 'ABC' from dual)
      9  SELECT id,
    10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
    11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
    12  FROM t
    13  GROUP BY id;
            ID MIN_ MAX_
            37 ABC  DEFG
            65 ABCD DEFG
            70John

Maybe you are looking for