How to get the size of the users screen

Hi
How can I tell my program the size of the screen of the user?

Try this link:
http://forum.java.sun.com/thread.jsp?forum=31&thread=57768

Similar Messages

  • How to get real size of the JLable with wrapped text

    Hello all,
    I have a JLable, which should display error message or some tips to the user. Text can have different length. Something like this:
    jlblText.setText("<html><body>Error. Please do this and that. </body></html>")
    view.pack();The lable is on the top of the JDialog.
    If user typed wrong data, an error message will be displayed in the lable. If the text is too long, jlable will be wrapped. JDialog should also adjust it's size, so I use pack().
    In this case nothing happens. I wanted to get the height of the component and to increase the size of the JDialog, but
    System.out.println("height = "+view.jlblText().getHeight());returns the same result all time. No matter whether the lable contains 20 lines or just some words.
    Is it possible to automatically adjust the size of the JDialog, if the size of the JLable is changed?
    In this case I can't use JScrollPane.
    Thanks in advance.

    component listener solved the problem.
    Try something like:
    label.setText(....);
    SwingUtilities.invokeLater(new Runnable()
         public void run()
              frame.pack();
    This construction didn't do the trick. I tryed to invoke this.pack() of my JDialog in a run method.
    I am still wonder, why only the component listener get the right (actual) value, and the getHeight() method called after the setText method returns the old value.

  • How Can I Determine the Size of the 'My Documents' Folder for every user on a local machine using VBScript?

    Hello,
    I am at my wits end into this. Either I am doing it the wrong way or it is not possible.
    Let me explain. I need a vb script for the following scenario:
    1. The script is to run on multiple Windows 7 machines (32-Bit & 64-Bit alike).
    2. These are shared workstation i.e. different users login to these machines from time to time.
    3. The objective of this script is to traverse through each User Profile folder and get the size of the 'My Documents' folder within each User Profile folder. This information is to be written to a
    .CSV file located at C:\Temp directory on the machine.
    4. This script would be pushed to all workstations from SCCM. It would be configured to execute with
    System Rights
    I tried the script detailed at:
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/03/31/how-can-i-determine-the-size-of-the-my-documents-folder.aspx 
    Const MY_DOCUMENTS = &H5&
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(MY_DOCUMENTS)
    Set objFolderItem = objFolder.Self
    strPath = objFolderItem.Path
    Set objFolder = objFSO.GetFolder(strPath)
    Wscript.Echo objFolder.Size
    The Wscript.Echo objFolder.Size command in the script at the above mentioned link returned the value as
    '0' (zero) for the current logged on user. Although the actual size was like 30 MB or so.
    I then tried the script at:
    http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_27869829.html
    This script returns the correct value but only for the current logged-on user.
    Const blnShowErrors = False
    ' Set up filesystem object for usage
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")
    ' Display desired folder sizes
    Wscript.Echo "MyDocuments : " & FormatSize(FindFiles(objFSO.GetFolder(objShell.SpecialFolders("MyDocuments"))))
    ' Recursively tally the size of all files under a folder
    ' Protect against folders or files that are not accessible
    Function FindFiles(objFolder)
    On Error Resume Next
    ' List files
    For Each objFile In objFolder.Files
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:01", objFolder.Path
    On Error Resume Next
    FindFiles = FindFiles + objFile.Size
    If Err.Number <> 0 Then ShowError "FindFiles:02", objFile.Path
    Next
    If Err.Number = 0 Then
    ' Recursively drill down into subfolder
    For Each objSubFolder In objFolder.SubFolders
    On Error Resume Next
    If Err.Number <> 0 Then ShowError "FindFiles:04", objFolder.Path
    FindFiles = FindFiles + FindFiles(objSubFolder)
    If Err.Number <> 0 Then ShowError "FindFiles:05", objSubFolder.Path
    Next
    Else
    ShowError "FindFiles:03", objFolder.Path
    End If
    End Function
    ' Function to format a number into typical size scales
    Function FormatSize(iSize)
    aLabel = Array("bytes", "KB", "MB", "GB", "TB")
    For i = 0 to 4
    If iSize > 1024 Then iSize = iSize / 1024 Else Exit For End If
    Next
    FormatSize = Round(iSize, 2) & " " & aLabel(i)
    End Function
    Sub ShowError(strLocation, strMessage)
    If blnShowErrors Then
    WScript.StdErr.WriteLine "==> ERROR at [" & strLocation & "]"
    WScript.StdErr.WriteLine " Number:[" & Err.Number & "], Source:[" & Err.Source & "], Desc:[" & Err.Description & "]"
    WScript.StdErr.WriteLine " " & strMessage
    Err.Clear
    End If
    End Sub
    The only part pending, is to achieve this for the 'My Documents' folder within each User Profile folder.
    Is this possible?
    Please help.

    Here are a bunch of scripts to get folder size under all circumstances.  Take your pick.
    https://gallery.technet.microsoft.com/scriptcenter/site/search?query=get%20folder%20size&f%5B0%5D.Value=get%20folder%20size&f%5B0%5D.Type=SearchText&ac=2
    ¯\_(ツ)_/¯

  • Time Machine on my iMac won't open iPhoto. It goes to desktop screen automatically. When I select User/Picture/Iphoto library it only brings up the preview page with the size of the folder. I can't get into the library to look for lost photos.

    Time Machine on my iMac won't open iPhoto. It goes to desktop screen automatically. When I select User/Picture/Iphoto library it only brings up the preview page with the size of the folder. I can't get into the library to look for lost photos.

    Thank You. This helps me alot to get into the masters and to see events and photos in a utilitarian way, but it is not as easy as viewing the normal iphoto format to find photos.  Can I do something else or did I not do something right to not see normal iphoto in Time Machine ?

  • How to get the size of the cuurrent illustration

    Sorry, I made a mistake before this one. The questios is this: can anybody tell me how can I get the size of the current illustration, (as oposed to the page size) in points. Something like 120 points wide and 87 points High?. What function do I need to call?

    From AI Function reference (included with CS2 SDK):
    AIDocumentSetup setup;
    error = sDocument->GetDocumentSetup(&setup);
    if (error) goto processError;
    writeDocumentSetup( &setup );
    The AIDocumentSetup record returns the following information:
    typedef struct {
    AIReal width, height;
    AIBoolean showPlacedImages;
    short pageView;
    AIReal outputResolution;
    AIBoolean splitLongPaths;
    AIBoolean useDefaultScreen;
    AIBoolean compatibleGradients;
    AIBoolean printTiles;
    AIBoolean tileFullPages;
    } AIDocumentSetup;

  • How to get the size of the webpage?

    I am designing a program to
    analyse the webpage content.
    wondering how to get the size of
    the webpage including its image's
    size and etc. Thanks in advance.

    As i know , the getContentLength just return
    then number of characters of its HTML code.
    By knowing the length of the HTML code, is
    not possible for me to calculate its download
    time... i wonder is there any way to get the
    total size of the page including its image size,
    applet size, and etc... Thanks : )

  • How to get the size of the table

    Hi All,
    How to get the size of the table in Oracle 10g?
    Is there any script which needs to be run?
    Regards,
    Apoorv

    Hi All,
    Sorry but somehow the table user_segments is not populated in my case. But we have another table SYS.ALL_TABLES whose structure is given below. Would I be able to calculate the table size based on the columns given below:
    ColumnName     Data Type
    OWNER     VARCHAR2 (30 Byte)
    TABLE_NAME     VARCHAR2 (30 Byte)
    TABLESPACE_NAME     VARCHAR2 (30 Byte)
    CLUSTER_NAME     VARCHAR2 (30 Byte)
    IOT_NAME     VARCHAR2 (30 Byte)
    STATUS     VARCHAR2 (8 Byte)
    PCT_FREE     NUMBER
    PCT_USED     NUMBER
    INI_TRANS     NUMBER
    MAX_TRANS     NUMBER
    INITIAL_EXTENT     NUMBER
    NEXT_EXTENT     NUMBER
    MIN_EXTENTS     NUMBER
    MAX_EXTENTS     NUMBER
    PCT_INCREASE     NUMBER
    FREELISTS     NUMBER
    FREELIST_GROUPS     NUMBER
    LOGGING     VARCHAR2 (3 Byte)
    BACKED_UP     VARCHAR2 (1 Byte)
    NUM_ROWS     NUMBER
    BLOCKS     NUMBER
    EMPTY_BLOCKS     NUMBER
    AVG_SPACE     NUMBER
    CHAIN_CNT     NUMBER
    AVG_ROW_LEN     NUMBER
    AVG_SPACE_FREELIST_BLOCKS     NUMBER
    NUM_FREELIST_BLOCKS     NUMBER
    DEGREE     VARCHAR2 (10 Byte)
    INSTANCES     VARCHAR2 (10 Byte)
    CACHE     VARCHAR2 (5 Byte)
    TABLE_LOCK     VARCHAR2 (8 Byte)
    SAMPLE_SIZE     NUMBER
    LAST_ANALYZED     DATE
    PARTITIONED     VARCHAR2 (3 Byte)
    IOT_TYPE     VARCHAR2 (12 Byte)
    TEMPORARY     VARCHAR2 (1 Byte)
    SECONDARY     VARCHAR2 (1 Byte)
    NESTED     VARCHAR2 (3 Byte)
    BUFFER_POOL     VARCHAR2 (7 Byte)
    ROW_MOVEMENT     VARCHAR2 (8 Byte)
    GLOBAL_STATS     VARCHAR2 (3 Byte)
    USER_STATS     VARCHAR2 (3 Byte)
    DURATION     VARCHAR2 (15 Byte)
    SKIP_CORRUPT     VARCHAR2 (8 Byte)
    MONITORING     VARCHAR2 (3 Byte)
    CLUSTER_OWNER     VARCHAR2 (30 Byte)
    DEPENDENCIES     VARCHAR2 (8 Byte)
    COMPRESSION     VARCHAR2 (8 Byte)
    DROPPED     VARCHAR2 (3 Byte)

  • How to get the size of the file

    Hi All,
    I want to get the size of the file in terms of bytes. I used the following code it returns the value in long how can get it in bytes
    import java.io.File;
    public class ServerBackupCheck {
         public static void main(String args[]){
              File f = new File("C:/Program Files/Apache Software Foundation/Tomcat 5.5");
              System.out.println(f.isDirectory());
              System.out.println(f.getTotalSpace());
    output:
    true
    20964163584
    regards,
    Maheshwaran Devaraj

    if it is a folder you can use this recursive algorithm
    public static long recurse(File f) throws IOException
              long bytes = 0;
              File files[] = f.listFiles();
              for(int i =0 ;i<files.length;i++)
                   File file = files ;
                   if(file.isFile())
                        FileInputStream fis = new FileInputStream(file);
                        byte[] by = new byte[fis.available()];
                        fis.read(by);
                        bytes = bytes + by.length;
                   if(file.isDirectory())
                        bytes = bytes + recurse(file);
              return bytes;
    System.out.println(recurse(f));  gives you the total bytes....
    Ayberk Cansever ..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I have a question about the new version of itunes. in the old version at the bottom of the sceen it display the total number of media and the size of the files. how can i get the new version to diplay this?

    in the old version at the bottom of the sceen it displayed the total number of media and the size of the files. how can i get the new version to diplay this?

    You're welcome. It was frustrating for me as well until I stumbled across "the fix"

  • Browser oppen and minimize fine but webpages do not. how do i get it to open to the size of the browser and stay that way with out zooming all the time

    I can not get a webpage to stay the size of the browser with out zooming in every time i go to a web page. With out zooming it just stay small with white on both sides. How do i get it to stay the size of the browser and stay that way Have no trouble with my internet explorer doing this on my new computer. or fire fox on my old computer.

    You can use an extension to set a default font size and page zoom on web pages:
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • How to open the browser window of the user to the size of the webpage ?

    Hello,
    My webpages are 1000 x 600 pixels, and I would like the browser window of any user opens in that size for he can see the website as I want to. Is it possible ? I guess it is because the pop-up windows of a "photo page" open to the size of the pictures (when you click on the miniature pictures), so iWeb should have this possibility.
    Can you help ?
    Thank you very much.
    Julien

    Here are some basic instructions for making html changes after publishing in iWeb:
    1. Publish your site via iWeb
    2. Find your html files.
    Go to iDisk/Web/Sites/iWeb/Sitename/Pagename.html
    (If you publish to a folder, look in the folder you selected or try looking in your Sites folder of your home folder. )
    There are two ways to handle accessing your iDisk.
    Method 1:
    Turn on local copy of your iDisk in System Prefs, with or without automatic syncing.
    If you publish your site via iWeb, now the updated pages exist online but the old pages are on your local iDisk. You need to sync (automatically or manually) to get the new pages on your local iDisk (on your computer).
    Then you can open the updated files, make your html changes in Text Edit or whatever program, and SYNC AGAIN (automatically or manually) to update the online version of the site to match what you have just changed on your local iDisk
    Method 2:
    Mount the iDisk when needed via the "Go" menu in Finder. This is the ONLINE VERSION of your iDisk, not a local copy. When you publish your site via iWeb, the changes INSTANTLY appear on the iDisk on your desktop. If you make html edits or other changes, they appear INSTANTLY online.
    I recommend Method 2 - much easier!!!
    3. Make the html changes.
    You can open the html files generated by iWeb in any text or html editor. In TextEdit, to view the code in an HTML file, choose File > Open and select "Ignore rich text commands." Then locate the .html file (as described in step 2) and click Open.
    Make your changes (i.e. follow the directions on the link provided by James - it worked for me when I entered that page, so the 2000 suggestion still works!) and don't forget to save your changes (not Save As, just Save)!!!
    4. Remember, if you make a change to a page like this post-publishing, and later re-publish, you have to make the html changes again! Set up a Find/Replace command in MassReplaceIt and you can do this very quickly. You can save your queries so you can make all of your changes with one click the next time you save.
    Download here:
    http://www.hexmonkeysoftware.com

  • How to get to know the size of the biggest file in ContentServer

    Dear colleagues!
    Does anybody knows how to get to know the size of the biggest file in the ContentServer?
    Vladimir
    Edited by: Vladimir Pavlovsky on Mar 2, 2010 11:11 AM

    Vladimir Pavlovsky wrote:>
    > Dear colleagues!
    > Does anybody knows how to get to know the size of the biggest file in the ContentServer?
    Hi Vladimir,
    I assume you want to know the size of the biggest file stored in the content server don't you?
    This information is available through the content server API layer only - so better open this question in the knowlegde management forum.
    regards,
    Lars

  • If I access the website of Cebu Pacific I get as reply upon entering a search request "HTTP Error 400. The size of the request headers is too long.", but if i use private browsing i do not get this reply. How do i resolve that?

    If I access the website of Cebu Pacific Air I get as reply upon entering a search request "HTTP Error 400. The size of the request headers is too long.", but if i use private browsing i do not get this reply. This refers to Firefox 5.0 on ubuntu 11.04
    I have tried to resolve this through deleting history and the cookies, but i always get the same reply. Although if i use firefox (ubuntu) private browsing or Firefox on Windows 7 i do not get this error message.
    What causes this error and how do i resolve this?

    Copied from the link mentioned below.
    ''That is usually a problem with corrupted cookies. Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies" ''
    https://support.mozilla.com/en-US/questions/785186?s=http+error+400&as=s
    Check and tell if its working.

  • How to get the size of the doc in XMLType

    Hi,
    I am using BFile to get an XML document into a table with an XMLType field. To get the content back out through COM I need to specify the size of the content to be returned. Is there a query I can run or function to call that will provide me with the size of the data? Its a 9.2 DB on NT.
    Thanks in advance for your help.
    Mike
    [email protected]

    Custom painting should be done in the paintComponent(...) method of the component. The is known at that time.
    Read the Swing tutorial on "Custom Painting":
    http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html

  • How to get the size of the test put in a JPasswordField ?

    I've checked all the methods that may allow me to know the size
    of the text in a JPasswordField.
    I tested getCaretPosition() , getSelectedEnd()
    and they don't satisfy me : they give the current position of the cursor
    and not the size of the text typed. The only safe method is the use
    of the method getText() which is deprecated, so that i can get the
    size of the resulting String.
    Is there a method that allow to know the size of a char arrays ?
    Any help will be welcome, thanks.

    JPasswordFieldObj.getPassword().length;the length variable isn't visible in the forte visual parameters.
    thanks a lot, it saved me a lot of time and let me keep the
    getPassword() secure.
    Sorry, don't have more duke dollars, but you should have get some for this.

Maybe you are looking for

  • New to the forums introdution / need a little help

    hi i've just recently build a new PC for Gaming CPU - Dual core E2200 RAM - 4GB VGA - 8500GTMSI 512MB i wonder if games like need for speed undercover and GTA IV will work fine ? 

  • Windows Vista Computer not showing up in finder

    Hi, my WIndows Vista computer is not showing up in finder under Shared. I can connect to my PC from my mac by clicking on finder, go, connect to server and typing in the PC's IP Address, Username and Password. I can also see my Mac computer from my P

  • Error 507 - I can not Update de OS

    Hello! I have the error 507 in my device BB 8320. I have run the Java Loader to uninstall the OS because I had problems with my carrier. Now I tried to update the soft from the new DTM (6.0) but this one does not give me the option "Update device". W

  • I want you to check why moderator locked my thread?

    I am a j2ee guy. from so long we are into this forum. I used to post and answer so many j2ee and java related threads. I have posted a thread and the discussion was going on, mean while in the discussion we ran into a geniric question on web applicat

  • Way to have a Spry table fill remainder of a window

    Does anyone know of a cross platform way to get a Spry table to fill the remainder of a window, assuming the top has, for example, controls for performing a query? None of the Spry samples I've seen are designed this way. But then I guess that's not