Adjust swing component size to the containing string

Hi,
I'm facing a problem with an application I am internationalizing. This application had all interface items with English strings but now it needs to display different languages. I'm doing this using ResourceBundles and properties files with the translated strings.
My problem is that while some strings fit nicely in the widget, others don't. For example, I have a button that displays "Run" in the English version and "Ejecutar" in the Spanish version. This doesn't happen, all I see is "Ejec..." .
Is there some way to tell a widget (JButton, JTextField, etc.) to adjust to the String's width?
Thanks in advance,
Lucas Vieites

I'd recommend to adjust the size of the dialog in accordance with the length of the messages.
This resize issue can happen even with the default language in case user change system font size.

Similar Messages

  • How to increase the heap size of the container in whioch BPEL is running ?

    Hi All,
    I recently raised an SR they have asked me to do the following,
    Can you please try and start the container running the BPEL process with max
    heap space (-Xmx) of 2 GB and the eden space (-Xmn) at about 60% of 1228m and
    the option -XX:+AggressiveHeap set. (even though this option is recommended for
    multi processor machines say 4)
    can anyone kindly explain me how to increase the Heap size and Eden size of BPEL container ?
    Thank You

    Hi Deepak I cant see any attribute or element in the oc4j_opmn.xml file regarding heap memory. In the server properties I changed the size of heap memeory how can I rollback.
    I am getting the following error
    Configuration information
    Running in C:\product\10.1.3.1\OracleAS_1
    Operation mode:Startup, App Server, No Enterprise Manager, Single Instance
    Oracle home:C:\product\10.1.3.1\OracleAS_1
    Oracle home name:Unnamed
    Instance name:SOA.01hw117905.India.TCS.com
    Instance type:allProducts
    Version:10.1.3.4.0
    Uses infrastructure:false
    Not an infrastructure instance, no infrastructure information available
    Components:[j2ee, apache, orabpel, oraesb, owsm, Wsil]
    2009-08-19 09:08:51.863--Begin log output for Mid-tier services (SOA.01hw117905.India.TCS.com)
    2009-08-19 09:08:51.863--Processing Step: starting OPMN
    2009-08-19 09:09:00.394--Processing Step: starting OPMN managed processes
    2009-08-19 09:09:35.19--End log output for Mid-tier services (SOA.01hw117905.India.TCS.com)
    An unknown OPMN error has occured
    oracle.appserver.startupconsole.model.ConsoleException: An unknown OPMN error has occured
         at oracle.appserver.startupconsole.control.OPMNController.doStart(OPMNController.java:121)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.control.GroupController.doStart(GroupController.java:47)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.view.controller.ControllerAdapter.start(ControllerAdapter.java:30)
         at oracle.appserver.startupconsole.view.controller.MasterControlAdapter.run(MasterControlAdapter.java:94)
         at oracle.appserver.startupconsole.view.Runner.main(Runner.java:39)
    Caused by: oracle.ias.opmn.optic.OpticControlException: Error from opmn during process control operation
         at oracle.ias.opmn.optic.AbstractOpmnEntity.runCommand(AbstractOpmnEntity.java:174)
         at oracle.ias.opmn.optic.AbstractOpmnEntity.start(AbstractOpmnEntity.java:110)
         at oracle.appserver.startupconsole.control.OPMNController.doStart(OPMNController.java:89)
         ... 6 more
    Exception caused by
    Error from opmn during process control operation
    oracle.ias.opmn.optic.OpticControlException: Error from opmn during process control operation
         at oracle.ias.opmn.optic.AbstractOpmnEntity.runCommand(AbstractOpmnEntity.java:174)
         at oracle.ias.opmn.optic.AbstractOpmnEntity.start(AbstractOpmnEntity.java:110)
         at oracle.appserver.startupconsole.control.OPMNController.doStart(OPMNController.java:89)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.control.GroupController.doStart(GroupController.java:47)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.view.controller.ControllerAdapter.start(ControllerAdapter.java:30)
         at oracle.appserver.startupconsole.view.controller.MasterControlAdapter.run(MasterControlAdapter.java:94)
         at oracle.appserver.startupconsole.view.Runner.main(Runner.java:39)
    <?xml version='1.0' encoding='WINDOWS-1252'?>
    <response>
    <msg code="-82" text="Remote request with weak authentication.">
    </msg>
    <opmn id="01hw117905:6200" http-status="206" http-response="2 of 3 processes started.">
    <ias-instance id="SOA.01hw117905.India.TCS.com">
    <ias-component id="default_group">
    <process-type id="home">
    <process-set id="default_group">
    <process id="172" pid="2176" status="Alive" index="1" log="C:\product\10.1.3.1\OracleAS_1\opmn\logs\\default_group~home~default_group~1.log" operation="request" result="success">
    <msg code="0" text="">
    </msg>
    </process>
    </process-set>
    </process-type>
    <process-type id="oc4j_soa">
    <process-set id="default_group">
    <process id="173" pid="5556" status="Stopped" index="1" log="C:\product\10.1.3.1\OracleAS_1\opmn\logs\\default_group~oc4j_soa~default_group~1.log" operation="request" result="failure">
    <msg code="-21" text="failed to start a managed process after the maximum retry limit">
    </msg>
    </process>
    </process-set>
    </process-type>
    </ias-component>
    <ias-component id="HTTP_Server">
    <process-type id="HTTP_Server">
    <process-set id="HTTP_Server">
    <process id="171" pid="2724" status="Alive" index="1" log="C:\product\10.1.3.1\OracleAS_1\opmn\logs\\HTTP_Server~1.log" operation="request" result="success">
    <msg code="0" text="">
    </msg>
    </process>
    </process-set>
    </process-type>
    </ias-component>
    </ias-instance>
    </opmn>
    </response>

  • Maximum size of the SSIS String Variable?

    In SSIS, what is the maximum size of the String variable (one that you would define in the Variables dialog box)?

     jwelch wrote:
    4000 is the limit on expressions. I'm not sure what the limit is on strings.
    This is all true.  Technically, I'm not sure there's a limit on the string variables.  Though you can't really use that variable anywhere without the 4000 character expression limit applying.  (Most of the time the variable is used in an expression SOMEWHERE...)

  • 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.

  • Get original component size in componentResized()

    Does anyone know how to get the original component size (i.e. the size prior to resizing) of a JComponent after the componentResized() method has been called. I need access to the original and the new component size in the componentResized() method. I am trying to avoid keeping and maintaining lots of arrays of component sizes on the basis I might need a component's size if it changes.

    This JPanel is managed by GroupLayout and all components in it have preferred sizes. All the layout for this JPanel is managed by the layout. I need the original component size (and new size) in the event handler method componentResized() because any component can be resized and the change in size affects other JPanels.
    Does anyone know if it is possible to get the original component's size from the componentResized() method and if so, how.

  • Can you control the Discoverer Portlet Size on the Portal Page?

    I have a Portal Page and I need the ability to control the Portlet size. The width seems to take on the dimensions defined for the region, but how do you control the dimension for the depth/length. Thanks.

    The size of the container is controlled by the Portal Page author through Portal, not the Discoverer Portlet. Unfortunately, I don't know exactly how to control this and it may be different from 9.0.2 to 9.0.4 (not sure which version you are using). You can check on the Portal forum.
    Discoverer Product Management

  • Hotel Menu Like Swing Component

    Hi , I need a swing component which has the functionality as below
    Initially, its looks like this
    # Beverages
    # Starters
    # MainCourse
    # Deserts
    When the user clicks on > it should expand that menu item and show the individual items along with their icons.
    # Beverages
           icon1 Tea
           icon2 Ice Tea
           icon3 Soft drink
    # Starters
    # MainCourse
    # Deserts
    Is there any readily available swing component which I can use for this behavior ?
    It is ok even the swing component misses out expand functionality when the "#" is clicked.

    But how can I set the icons to what I need ? Read the tutorial!!!
    There is no way you could have read the tutorial and understand how a JTree works in 10 minutes.
    So do some work on you own. Read the tutorial. Search the forum for examples.
    We've pointed you in the right direction so do some learning on your own.

  • When does a JTabbedPane set the size of the component inside a tab?

    I would like to know how big a component inside a tab is directly after I've added it to a tab in a JTabbedPane.
    I thought once I've "added" a component via the JTabbedPane.add(String, Component) method, the Component would be realized with correct sizes.
    Where or when should I request the information about how big a component has become inside a tab??
    Example:
    1. "Add" a tab via the menu.
    2. Notice that the size of the panel has not changed even though we see it on the screen.
    -Js
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    public class TabbedPaneShowingTest extends JFrame
         //GUI
         private JTabbedPane tabbedPane;
              private JPanel tabPanel;
         //MENU
         private JMenuBar mainMenuBar;
              private JMenu actionMenu;
                   private JMenuItem addTabMenuItem;
         public TabbedPaneShowingTest()
              this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
              this.setContentPane(getTabbedPane());
              this.setJMenuBar(getMainMenuBar());
              this.pack();
              this.setVisible(true);
         //GUI
         private JTabbedPane getTabbedPane()
              if(tabbedPane == null)
                   tabbedPane = new JTabbedPane();
                   tabbedPane.setPreferredSize(new Dimension(100,100));
              return tabbedPane;
         private JPanel getTabPanel()
              if(tabPanel == null)
                   tabPanel = new JPanel();
                   tabPanel.setBackground(Color.GREEN);
              return tabPanel;
         //MENU
         private JMenuBar getMainMenuBar()
              if(mainMenuBar == null)
                   mainMenuBar = new JMenuBar();
                   mainMenuBar.add(getActionMenu());
              return mainMenuBar;
         private JMenu getActionMenu()
              if(actionMenu == null)
                   actionMenu = new JMenu("Action");
                   actionMenu.add(getAddLineMenuItem());
              return actionMenu;
         private JMenuItem getAddLineMenuItem()
              if(addTabMenuItem == null)
                   addTabMenuItem = new JMenuItem("Add Tab");
                   addTabMenuItem.addActionListener(new ActionListener()
                        public void actionPerformed(ActionEvent e)
                             System.out.println("BEFORE TAB SIZE: " + getTabPanel().getWidth() + "," + getTabPanel().getHeight());
                             getTabbedPane().add("Tab",getTabPanel());
                             System.out.println("AFTER TAB SIZE: " + getTabPanel().getWidth() + "," + getTabPanel().getHeight());
              return addTabMenuItem;
         public static void main(String args[])
              new TabbedPaneShowingTest();
    }

    Once again... a little experimenting is a good thing. Just use SwingUtilities.InvokeLater() to retrieve the proper size.
    -Js
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JTabbedPane;
    import javax.swing.SwingUtilities;
    public class TabbedPaneShowingTest extends JFrame
         //GUI
         private JTabbedPane tabbedPane;
              private JPanel tabPanel;
         //MENU
         private JMenuBar mainMenuBar;
              private JMenu actionMenu;
                   private JMenuItem addTabMenuItem;
         public TabbedPaneShowingTest()
              this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
              this.setContentPane(getTabbedPane());
              this.setJMenuBar(getMainMenuBar());
              this.pack();
              this.setVisible(true);
         //GUI
         private JTabbedPane getTabbedPane()
              if(tabbedPane == null)
                   tabbedPane = new JTabbedPane();
                   tabbedPane.setPreferredSize(new Dimension(100,100));
              return tabbedPane;
         private JPanel getTabPanel()
              if(tabPanel == null)
                   tabPanel = new JPanel();
                   tabPanel.setBackground(Color.GREEN);
              return tabPanel;
         //MENU
         private JMenuBar getMainMenuBar()
              if(mainMenuBar == null)
                   mainMenuBar = new JMenuBar();
                   mainMenuBar.add(getActionMenu());
              return mainMenuBar;
         private JMenu getActionMenu()
              if(actionMenu == null)
                   actionMenu = new JMenu("Action");
                   actionMenu.add(getAddLineMenuItem());
              return actionMenu;
         private JMenuItem getAddLineMenuItem()
              if(addTabMenuItem == null)
                   addTabMenuItem = new JMenuItem("Add Tab");
                   addTabMenuItem.addActionListener(new ActionListener()
                        public void actionPerformed(ActionEvent e)
                             System.out.println("BEFORE TAB SIZE: " + getTabPanel().getWidth() + "," + getTabPanel().getHeight());
                             getTabbedPane().addTab("Tab",getTabPanel());
                             SwingUtilities.invokeLater(new Runnable()
                                  public void run()
                                       System.out.println("AFTER TAB SIZE: " + getTabPanel().getWidth() + "," + getTabPanel().getHeight());
              return addTabMenuItem;
         public static void main(String args[])
              new TabbedPaneShowingTest();
    }

  • Problem with the size of the component resided in the same panel

    Hello,
    I am very new to Swing Programming in my application I have put TextField,tree and listbox.
    These all are resided in the same panel and I have set GridLayout to display them all in one column and 3 rows.
    Now I want to resize individual component resided in the panel because they take all the components with the same size.
    Thanks in advance

    i'll suggest you to use GridBagLayout instead of GridLayout
    http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html

  • Adjusting the size of the "pop up" sub vi in the main vi

    I am trying to reduce the size of the "pop up" sub vi in the main vi. If I push everything upwards, the info downwards is lost. Similarly the side info is lost. How to adjust the size and yet keep all the info. I am using LV6.0. I have attached the file concerned.
    Attachments:
    RTF Test Setup.doc ‏84 KB

    There is obviously a misunderstanding here.
    You have full control over the front panel and you can make all the controls as small or large as you want. In addition, you can also place them wherever you want. It is up to you as the designer to place them how you want. If you want then all to be a few pixels by a few pixels, LabVIEW will allow that. Obviously, a string control that is 3 pixels wide and 2 high is unusable, but you can do it. In addition if you wanted all the controls to over lap that is fine, but again it will most likely be unusable for your user.
    If your question is the mechanics of moving and re-sizing controls, LabVIEW works the same as most products. You need the arrow tool, which you can get from the tools pallette (Windows>> Show Tools Pallette). With that tool you simply click on the control and move it where you want it. To resize it you hover over the borders of the control until you see the little resize squares and then re-size away. This is the same as how you would re-size an object in Word etc.
    If you are simply asking for some examples based on the front panel you attached, we on the forums can move them around and give you examples but we don't know what it is you as the designer or your "customers" want. Therefore anything we do is a shear guess and unlikely to be what you really want. By far the best option is for us to help answer for you the how so that you can create the front panel that you want.
    So can you re-phrase the question or help us understand what it is you want?

  • Adjusting multiple images to be the same size?

    Hi,
    I'm trying to create a photo collage in Photoshop that consist of multiple photos imported as Smart Objects into layers, that are all the same size. Ideally, I'd like to be able size/crop/scale each image as a group, or individually, on the fly. So lets say that I have 6 images as Smart Objects on layers, and that they are all of varying sizes, and I'd like to adjust each image to be the same precise size, 2" x 3". Maybe later I decide that they should all be 2.5" x 3."5, can I easily change all 6 images at once? I've tried going into Free Transform and changing the size of each individual image here, but I can't get the precise size that I want. Is there a way that I can open a dialog box, and specify the exact size? Can I then repeat this for all images/layers that I've selected?
    I hope this makes sense, and that someone has a brilliant idea on how to do this?
    Thanks!
    Jeff

    Image Processor doesn't get me what I'm after.
    Photoshop has the option to create a contact sheet. So imagine that I want to create a contact sheet of images, but keep them on separate layers, and be able to change the size of the images as I feel, to fit my collage.

  • For the life of me, I can't find out what size a photo is in terms of inches or how to change the size of the photo[s] so I can print them. I think I read somewhere to click edit, then click adjust. Nothing there about sizing.

    For the life of me, I can't find out what size a photo is in terms of inches or how to change the size of the photo[s] so I can print them. I think I read somewhere to click edit, then click adjust. I don't see anything about re-sizing when I click the adjust tab: only saturation and tint levels. Thank you.

    With respect to digital images, there really is no size in inches. The size is given as number of pixels horizontally and vertically. In iPhoto '09 you click the little "i" inthe lower right side of the window and it will display information related to the selected photo, including the pixel dimensions. I do not have iPhoto '11 installed so I don't know if it is the same there.
    In some applications, such as preview, it has something additional called Dots per Inch (DPI) which you would think would allow you to convert the pixel dimensions to inches. It is not a real thing, though. The DPI is determined by how large or small you have chosen to print your photo and the capabilities of your printer. 
    There is also something called Aspect Ratio, which is usually expressed in inches x inches such as 6x9 but that doesn't mean the size on the screen or when printed is 6x9.  It is the ratio of the pixel dimensions.  When cropping your photos, you will have several standard aspect ratios to choose from plus any custom ones you create.
    In iPhoto '09, after you choose Print, in the Print Setting window are the settings for the size you want the photo printed. You want to shoose a setting with the same aspect ratio of your photo. Otherwise, iPhoto will resize and/or crop your photo to fit the size you have chosen. 

  • How to change the font size of the string by using java?

    I wish to change the font size of the text, read from a text file by using java. Please send me the sample codes. By using ActiveX component for word we can do it. Please give me any other solution to suit the platform independ. Thanks in advance.
    thanks,
    Karthik.

    Text is displayed in some kind of text component - JTextField, JTextArea, JTextPane....To change the font of the text you change the font associated with the text component:
    textComponent.setFont( .... );

  • Can I adjust size of the photos on front page of the photo album template?

    When I am working on a Photo Album page, how can I make the "front page" photos larger? I am talking about the photos arranged in rows, not the photos that show in the slide show carousel. Is it a set size in the Photo Album template or is it a consequence of how large a photo I set into the page?
    Also, how is "large" defined? Is it about inches, or is it about resolution?
    — Lorna in Southern California

    I found the large too large and the small too large.
    How large do you want them Lorna?
    .......... Lorna says ................................................
    Michael, where did you go to check to see that the large was indeed too large and the small too large? What method of adjusting the size are you using?
    If you want them really large, why don't you just
    plonk the real photo on the page sized as large as
    you wish, and you can always link it to its own page
    with an even larger version!!
    .......... Lorna says ................................................
    Michael, actually I misstated in my first post. Actually I would not like the photos in the Photo page to be too large, because then no one will be motivated to click onto the See Slideshow button.
    My mind is getting so crammed with input and other people's websites that I now cannot even recall with certainty which pictures I wanted larger. 8-( Oh, this is giving me a cramped-in-the-chest feeling. I had best take a break now and finally eat a legitimate meal.
    — Lorna in Southern California

  • Find the container name of a component

    hi
    how does one get the container name of a component on the component's actionListener event.
    i have a ' N ' number of JInternalFrames in which there are multiple JToggleButtons. On the actionListener event of the togglebutton i would like to know the name of the internalframe which is holding it. how do i get that name.
    Plz suggest Thanks Trushant

    NO it did not work. getTopLevelAncestor() function returns me the main frame on which i have all the jinternalframes . is there any way to know the next immediate container of the component.
    Anyways thanks for consideration .

Maybe you are looking for