How can I set the size of an image in java?

How can I set the size of an image in java? I have to choose the width and height of image...thanks to everybody...sorry for my english :-)

Hi 43477
Can you provide more details, do you want to setsize to display an image on a screen of when saving image etc?
PS.
There is a good invention called googlegoogle is good, but sometimes it's better to use more specific search, there is a search field avove on this page :)

Similar Messages

  • How can I set the size of the font so I don't have to change every new word?

    How can I set the size of the font so I don't have to change every new word?

    In what application?

  • HELP !!! How can I set the size of each component separately

    Please tell me, when adding components (a mix of
    labels , buttons etc.) on a container (swing), how can I set the size
    of each component separately.
    for example:
    the code here has a mix of button and a grid that is actually another JPanel. Its a part of a bigger
    program. When running the grid is cut (not seen in its full size).
    So, please try to anser also about the specific acse of frame contining another frame in it , and the interior should be right sized.
    The relevant part of the code:
    =========================================
    public class Reversi extends JFrame {
    public static void main(String[] args) {
    Reversi ourGame = new Reversi();
    public Reversi() {
    super("Grid Reversi");
    setSize(new Dimension(300, 300));
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    Grid g = new Grid(); // the grid was built at another part..
    ReversiGame ourGame = new ReversiGame();
    JButton b;
    JFrame f = new JFrame("Hello Java");
    f.setSize(new Dimension(300, 300));
    f.setDefaultCloseOperation(EXIT_ON_CLOSE);
    Container c = f.getContentPane();
    c.add(g,BorderLayout.NORTH );
    c.add(b = new JButton("Hola"), BorderLayout.CENTER);
    //f.pack();
    f.show();

    BorderLayout chooses the sizes of each of the components added to it. Choose a different layout manager (or set the placement/size manually with a 'null' layout)
    http://java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html

  • How can I set the size of combo boxes on a toolbar

    Hi, I am trying to use setMinimumSize of a combo box on a toolbar, It doesn't seem work. The code as following? Can anyone tell me how I can do it ?
    JComboBox sw = New ComboBox();
    sw.setMinimumSize(new Dimension(10,10));
    Thank you.
    Scott

    use the method preferred size of the JComponent superclass of the combos:
    setPreferredSize
    public void setPreferredSize(Dimension preferredSize)
    Sets the preferred size of the receiving component. If preferredSize is null, the UI will be asked for the preferred size.

  • How can i set the size of the task windows and text to something more suitable?

    When i bought my HP Touchsmart 600 pc the text size and window size on the desktop were tiny as Default, i manage to change it where it wasnt to big or small it was just right.
    but recently i had to restore my whole computer back to factory settings and now the text is huge and the windows are coming up big as well. i played around in the display settings and put it at 100% default and that doesnt help i then tried it on 125% but that is still big...
    i cant remember how i did it last time and its really hard to explain. but could anyone help me and point me in the right direction cause its annoying i use to fit like 10 icons vertically in a row on my desktop now i can fit only 8 and the start menu comes up huge.
    so if any one could help me out it would be great! thankyou in advance. 

    Hi 43477
    Can you provide more details, do you want to setsize to display an image on a screen of when saving image etc?
    PS.
    There is a good invention called googlegoogle is good, but sometimes it's better to use more specific search, there is a search field avove on this page :)

  • How can I set the date of my PC using Java?

    Which class has the function to set system date and time.
    Thanks in advance.

    but the following sentence
    Process p=Runtime.getRuntime().exec("date
    11-03-2002");
    always throw IOExecption error
    java.io.IOException: CreatePreocess:date 11-03-2002
    error=0
    and why?
    How to settle it?
    'date' is an internal command which means you need a shell to run it. Depending on the OS this will either be 'cmd' or 'command'. If you search the forums with the following keywords you will find examples on how to use this: "exec", "Runtime", "cmd" or "command"

  • Formatting issues: when I open a msg, the font is sooo small you need a magnifier to read it. How can I set the font size to one I can easily read?

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    I have various formatting issues:
    a. When I open a msg from my web browser (Cablevision), the font is sooo small I need a magnifier to read it. How can I set the font to a size I can easily read?
    b. When I forward msgs, the text gets all distorted and I need to clean it up (some symbols, lots of spaces between words). How can this be fixed?
    c. When I want to tell someone about a website, I cannot type the URL in so that all they have to do is click on it. How can this be fixed?
    d. When I open messages, the text opens in a small window and covers the "Show Images" button. Why?
    == This happened
    ==
    Every time Firefox opened
    == Ever since I started using Firefox (a few months ago)
    ==
    '''Troubleshooting information'''
    I didn't find any results
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows 7
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-nphpclipbook
    *Office Plugin for Netscape Navigator
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *The Hulu Desktop Plugin allows Hulu.com to integrate with the Hulu Desktop application.
    *Shockwave Flash 10.0 r45
    *Adobe Shockwave for Director Netscape plug-in, version 11.5
    *iTunes Detector Plug-in
    *3.0.40624.0
    *NPWLPG
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers

    The text editor is the text area that you use on the webmail (Yahoo, Hotmail) website to create a new mail.
    You can compare that with the ''Post new message'' text area that you use to create a new post on this forum.
    Just above the text area that you use to enter the message text there is usually a button bar with buttons that allows some text formatting like Bold and Italic and can also include a button to make a clickable hyperlink.
    Check the tooltip of each button by hovering with the mouse over each button.
    Make Link - https://addons.mozilla.org/firefox/addon/142

  • 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
    ¯\_(ツ)_/¯

  • How can I control the size of a cell in the GridBagLayout?

    Hi,Swing Gurus
    I am developing a swing-based program using JBulider5 enterprise.
    It seems to me that the GridBagLayout is really a hard nut!
    How can I control the size of a cell in the GridBagLayout?
    It seems that I cann't control the size of a cell directly.
    But how the size of a particular cell is determined when I switch the layout manager from XYLayout to GridBagLayout?
    Thx in advance!
    Regards,
    Justine

    hi,i have not done what you are asking but there are fields like
    COLUMNWIDTH, MINSIZE, MAXGRIDSIZE, PREFEREDSIZE to which you can set the appropriate values and test for your need.hope this helped.bye martian.

  • How to set the size of an Excel-file,Java created in tabbed forma

    Hi all,
    I'm creating an Excel-file by writing data to an outputStream in tabbed format.
    My problem is : How can I set the width of the columns of that Excel-file, not the default-size?
    If anyone can help, that would be very nice.
    Thanks a lot,
    Regards,
    Tim

    You can write a generic xls file containing a Macro to open and set the column widths of text or csv files. Your java program can then call this generic file to open your text files.

  • How can I set the width of a Text element?

    Hello! I have created a custom button with this class:
    import javafx.scene.Node;
    import javafx.scene.CustomNode;
    import javafx.scene.Group;
    import javafx.scene.Cursor;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.paint.Color;
    import javafx.scene.paint.LinearGradient;
    import javafx.scene.paint.Stop;
    import javafx.scene.effect.DropShadow;
    import javafx.scene.text.Text;
    import javafx.scene.input.MouseEvent;
    public class Button extends CustomNode {
        public var text: String;
        public var x: Integer = 0;
        public var y: Integer = 0;
        public var width: Integer = 90;
        var height: Integer = 25;
        override public function create(): Node {
            return Group {
                content: [
                    Rectangle {
                        cursor: Cursor.HAND;
                        x: this.x;
                        y: this.y
                        width: this.width;
                        height: this.height;
                        arcWidth: 15;
                        arcHeight: 15;
                        effect: DropShadow {radius: 6};
                        fill: LinearGradient {
                            startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                            stops: [
                                Stop {offset: 0.0, color: Color.WHITE}
                                Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMouseEntered: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.2, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMouseExited: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                        onMousePressed: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.LIGHTGRAY}
                                    Stop {offset: 1.0, color: Color.WHITE}
                        onMouseReleased: function(e: MouseEvent): Void {
                            (e.node as Rectangle).fill = LinearGradient {
                                startX: 0.0, startY: 0.0, endX: 0.0, endY: 1.0
                                stops: [
                                    Stop {offset: 0.0, color: Color.WHITE}
                                    Stop {offset: 1.0, color: Color.LIGHTGRAY}
                    Text {
                        x: this.x + 5, y: this.y + 16
                        content: this.text
    }But, how can I set the Text element centered into the button?

    Stack {
                        layoutInfo: LayoutInfo {
                            width: bind width;
                            height: bind height;
                        content: [Rectangle {
                                width: bind width, height: bind height
                                //fill: bind color;
                                fill: Color.GREEN
                                arcHeight: 20; arcWidth: 20;
                            Text {
                                font: Font {
                                    size: 24
                                textAlignment: TextAlignment.CENTER;
                                wrappingWidth: width;
                                boundsType: TextBoundsType.VISUAL;
                                fill: Color.WHITE;
                                content: bind text;
                    }wrappingWidth: Sets the maximun width of the text
    boundsType: If you put the wrappingWidth var and you want to center a text you MUST set this var to VISUAL

  • How do i set the size of 3d picture control

    dear sir,
                I have attached my vi.I have one doubt  ie I have used translate object. vi in my vi to move my picture according to the value set by the y position.This y position indicates depth my object.this is sample object  insteat of i am going to update my underwater vehicle.
    What my problem is when i chnage the y value beyond 200 I can not see my picture.so  how do i set the size of the 3d picture control size.
           I have to see my picture within the 3d picture control eventhough i change the y value between 0-500,how do i solve my problem.
    Another my doubt is how do i show the depth value (ie y value in translate object .vi) in 3d picture control ie while the picture is moving in a 3d picture control at the same time i want to display the corresponding depth rating in the 3d picture control
    Pls anyone suggest me as soon as possible.
    Thanks and regards
    jayanthi.k
    Attachments:
    Untitled 1.llb ‏67 KB

    Jayanth,
    Take a look at the attached example.  Alternatively, you can search for it in NI Example Finder by going to Help>>Find Examples in LabVIEW, click on the search tab, and search for meshes.  I had difficulty reading your code, but I believe you need to position your lighting source in the optimal location to get better definition.  And the example shows how to bind a color to the object.
    Trey B
    Applications Engineering
    National Instruments
    Attachments:
    Using Meshes.vi ‏76 KB

  • How can I reduce the size of IPhoto ?

    I have tested IPhoto with a few hundred pictures.
    I do not find this software very user-friendly, in particular because I can no longer locate the files of these pictures. I kept fortunately a copy of my complete set of my photo collection.
    I removed all pictures from IPhoto, but the application shows a size of 600 Mb.
    How can I reduce the size of IPhoto and recover this storage space?

    patrick
    in particular because I can no longer locate the files of these pictures.
    There are three ways (at least) to get files from the iPhoto Window.
    1. Drag and Drop: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. File -> Export: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. Show File: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Rolls in the iPhoto Window (View -> Film Rolls) correspond exactly with the Roll Folders in the Originals Folder in the iPhoto Library Folder. You can move photos between Rolls, you can rename rolls, edit them, create them, as long as you do it via the iPhoto Window. Check out the Info Pane (wee 'i', lower left) the name and date fields are editable. Edit a Roll Name using the Info Pane, the Roll Folder in iPhoto Library Folder/Originals will also have the new name.
    You might also like to explore the iPhoto tutorials at http://www.apple.com/ilife/tutorials/iphoto/index.html
    Use the Get Info window to remove unwanted language resources.
    Regards
    TD

  • How can I reduce the size of icons on my desktop?

    How can I reduce the size of icons on my desktop?

    Click Finder, view, show view options, and then set icon size. You can size them and see the effects to choose what works for you.

  • How can I set up a repeatable bulk image size reducer?

    How can I set up a repeatable bulk image size reducer?

    File > Scripts > Image processor.  It's pretty straight forward.
    Although I used the free Irfanview for many years.

Maybe you are looking for

  • Border selection in V3.2

    Hi hi, Previously, in numbers '09 it was possible to select individual border, then to copy/paste style. Cannot find that In new version. Is it dissabled in v3.2?

  • Can we call 10g Report from Form-6i???

    Hi buddies.....Can we call a report developed in 10g reports from a 6i Form using Run_Report_Object???

  • Problem on printing document

    brothers when i want to print to word 2007 document in colour it only printed in black why,how to fix? HP Deskjet 1050 J410

  • OEM 10g grid.... Please help..

    Hi all Please can someone help... Im new at this and Im having afew issues.. Im running Oracle 10g grid on AIX box . The install went well and Im able to connect to all targets.... 1) The repositry database startsup without any error messages but in

  • How to Re-query a standard form.

    Hi there, There is a need to Requery a standard Service Request Form. When "Launch Workflow" button is pressed, it updates a DFF at the database. After this if we wish to add description in Task Description Field, it throws error "Record updated by a