Components Resizing to follow width of applet

Hi,
does anyone know how i can stop components from resizing to follow the width of the applet they are in once i have grabbed the applets edges?
Thanks
Richard.

Darryl.Burke gave some excellent advice.
Still, I am prepared to go out on a limb and make a WAG that you are talking about a floating applet.
This occurs in three cases..
1) The applet is in development/testing and launched by applet viewer.
2) The applet is deployed, and launched using webstart (also shown using applet viewer).
3) The applet is targeted at a 1.6.0_10+ VM, and has a JNLP file specified - so it is dragable.
In the first case, it is irrelevant if the applet will become a 'plain old embedded' applet, which is (usually) not resizable.
In the second and third cases, you probably need to look to the layouts used for the components. To prevent the components from resizing, either a FlowLayout or BoxLayout would probably be required.
As an aside, one way to indicate interest in a solution is to add [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview], though DB's advice will get you further. I recommend doing/acting on both.
Edited by: AndrewThompson64 on Aug 28, 2008 11:05 AM

Similar Messages

  • 1. Resizing of column width. 2. Drag and drop of columns for resequencing

    QUERY : Has anyone some experience in implementation/development of following functionality in a JSP/Tomcat server based application:
    1. Resizing of column width for a result which has multiple columns. .2. Drag and drop of these columns or any other mechanism for re-sequencing the columns?
    I would like to know will JSF would be helpful in it.

    Amit,
    The column resizing and 'drag and drop ' are client side issues. They requires DHTML and Javascript.
    AJAX is what is required. (wiki AJAX for more info)
    I am working on an AJAX grid and combobox component for JSF that will do this and many more functions.
    Let me know if you want more information.
    [email protected]

  • Help with Resizing of column widths in a pivot

    HI all,
    I m working on resizing the pivot coulmn width in a dashboard. Could anyone please help with resizing the pivot width. Autosize() works but user doesnt want that.
    Whats the code to do that?

    I read what was written but still am confused. I am completely lost at this pointWhat is confusing you? A TreeMap is just a HashMap where the key is stored is sorted order.
    Read the Collections tutorial found [url http://java.sun.com/docs/books/tutorial/]here.

  • Resize jtable column width

    I am trying implement a utility in JTable by which when a person clicks on the column header, the whole column should resize according to the cell which has lengthiest data. If you have seen this in MS Excel where by clicking on the column this happens. I want the same thing.
    Is there anyway already defined in javax.swing?
    I have added a Mouselistener on Tableheader and when the person clicks on a column header, I first finds out the column index. Now on that column index scan the whole column for the lengthiest data. After finding the lengthiest data I set the preferred width for that column and call doLayout on the table object. In this case the problem is of font as the font is not fixed width. The multiplication factor which returns the pixel doesn't gives the right pixel width. Is there any way by which I can find pixel width of a String?

    Use the following code to compute the width of a
    column in pixels required to display the maximum sized
    string in the table column:
    FontMetrics fm =
    table.getFontMetrics(table.getFont());
    int width =
    SwingUtilities.computeStringWidth(fm,maxSizeString)
    //then to set the width of your column:
    TableColumnModel columnModel =
    table.getColumnModel();
    TableColumn column =
    columnModel.getColumn(YOUR_COLUMN);
    column.setPreferredWidth(width);Rizwanthx that was usefull

  • Form Resize Affect Column width?

    Hi Folks,
    I have a very strange problem. I try to add a new matrix to Production Order form. The matrix will have 2 columns which are:
    1. No - Non Editable (for numbering)
    2. Description (information).
    My code is like the following:
            oItem = oForm.Items.Add("mxRoute", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
            oItem.Left = 12
            oItem.Width = 532
            oItem.Top = 136
            oItem.Height = 183
            oItem.FromPane = 3
            oItem.ToPane = 3
            oMatrix = oItem.Specific
            oColumns = oMatrix.Columns
            '// Adding Culomn items to the matrix
            oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "#"
            oColumn.Width = 20
            oColumn.Editable = False
            oColumn = oColumns.Add("Col1", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oColumn.TitleObject.Caption = "Operations"
            oColumn.Width = 500
            oColumn.Editable = True
    The problem occured when i try to maximize my form. The first Col (#) will resize to a very big size!!! When i try to resize it to smaller form, it still very big column. Anybody has clue what should i do to the form since it is not possible to restrict the form type to Fixed???
    Your help will be very appreciated..
    Rgds,
    Harianto Ng

    Hi Harianto Ng,
    Catch the after resize event and resize both columns by hand.
    1. calculate width of columns 1 + 2
    2 resize the first to 20
    3 resize the second to totalwidth-20
    Regards
    Ad

  • Why can't I resize jpg images in the applet?

    I used this code to display images in an html page. One applet for one image. But out of the 8 images I loaded, 6 adjusted themselves to 320x240 automatically, 1 randomly jumps around to certain parts of the image every 250millisecs, and 1 just cuts the top left hand part of 320x240. How can .jpg files give 3 different situations? I tried using the resize() method in the code but it doesn't do anything! How can I size those .jpg images to the size I want?
    /**This video stream applet loads a new image every 250ms
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import java.awt.event.*;
    public class Video extends Applet implements Runnable{
    private Image img,buffer;
    private Thread video = null;
    private URL url;
    private MediaTracker tracker;
    public synchronized void init(){
    tracker = new MediaTracker(this);
    try{url = new URL(getCodeBase(),"Camera1.jpg");}
    catch(MalformedURLException e){}
    img = getImage(url);
    tracker.addImage(img, 0);
    buffer = createImage(320,240);
    resize(320,240);
    if(video!=null)return;
    video = new Thread(this,"VideoStream");
    video.start();
    public synchronized void destroy(){
    if(video!=null)video=null;
    public void run(){
    while(!Thread.interrupted()){
    // Load new image.
    try{tracker.waitForID(0);}
    catch(InterruptedException e){}
    // Draw new Image.
    repaint();
    // Remove old image & add new one.
    tracker.removeImage(img,0);
    img.flush();
    tracker.addImage(img,0);
    // Sleep
    try{Thread.sleep(250);}
    catch(InterruptedException e){}
    public synchronized void update(Graphics g){
    Graphics bufGraph = buffer.getGraphics();
    bufGraph.drawImage(img,0,0,this);
    paint(bufGraph);
    g.drawImage(buffer,0,0,this);
    public void paint(Graphics g){
    g.drawImage(buffer,0,0,this);
    Also how can I add more than 1 .jpg in an applet since the applet tag for html is
    <applet code = Video.class width =... height = ...>
    <param name = "buffer" value = "Camera1.jpg"> ...and I can only put
    </applet> one file for "value
    Thanks a lot for ur help!

    you may try the function getScaledInstance(int,int,int) in Class Image.
    the first and second parameters are the width and height you want,the third parameter is hints-flags to indicate the type of algorithm to use for image resampling.

  • Is it possible to resize page column widths at runtime (by the user)?

    hi all,
    i have cretaed a page using the 2-columns narrow/wide layout.  this layout is perfect for what i want to do.
    however, the users have complained that they would like to be able to resize the columns, just like they are able to do with the Detailed Navigation column (using the small "<" and ">" arrows).
    is it posssible to add this functionality to my custom pages so that can also resize the columns?
    i searched for options in the properties, but didn't find anything.
    thanks,
    mm

    This was a great place for me to start
    Thank you
    I took profdant139's suggestions a bit further as my real goal was to have the "Document column" narrower. The goal to be able to see all the other document info that was usually hidden way out to the right
    To achieve my results I right clicked in the upper bar with the column names and chose from the drop down box "comments" column (as suggested). I then dragged it to the far right. This pushed all the other columns over.
    In the end of the day I ended up adding "Size" and "Date modified" columns as well to get my desired results.
    Remember one can move different columns around to be in the order you need by clicking on the column to get it active and then left click and drag it to where you want
    Another great thing is that by default (Using Mavericks) the date modified, opened,created columns have date and time. One can shrink them down to xx/xx/xx format by manually adjusting the column width like one does in Excel - click on column separator up top and drag
    Once all that is done, at least on my box, I closed it out and opened up a new finder window and everything was as I wanted.
    Thank you for the help  from the above helper to get me here

  • Let user drag drop dynamic components, resize them

    I'm just wondering how you can create UI components and let
    the user drag and drop them on the screen
    let the user resize the elements, change the text for example
    or rotate the element (just like scrapblog)
    Lets say you want to have an image object.
    Do have to create your own custom components that inhertis
    from the image component
    add some kind of handle objects and handle al the events so
    the user can change the size and rotate it
    Or is there a much easier way of doing this kind of cool
    stuff
    If anyone knows how this kind of technique is called, let me
    know its hard to find something about it (in any language,
    if i search for wysiwyg drag and drop in flex or .NET i
    mostly get results like FlexBuilder en Visual Studio not how to
    program such special components)
    grtz

    Did some more searching and already found some cool examples
    http://www.rogue-development.com/objectHandles.html
    http://blogs.adobe.com/flexdoc/2007/03/creating_resizable_and_draggab.html
    more examples are still welcome :)

  • Running the following keygeneration on applet

    Hai,
    The following is a java code for generating a keypair. How i can convert this code into applet. suppose i want to showthe public & private keys in a text box. i tried to chage the system.out.println statement but it gives some errors. especially when i try to assign the value to text box it gives some error in data type.
    expecting ur help
    anu
    import java.security.KeyPairGenerator;
    import java.security.NoSuchAlgorithmException;
    import java.security.KeyPair;
    public class AsymmetricKeyMaker {
    public static void main(String[] args) {
    String algorithm = "DH";
    if (args.length == 1) algorithm = args[0];
    try {
    KeyPair keyPair = KeyPairGenerator
    .getInstance(algorithm)
    .generateKeyPair();
    System.out.println(keyPair.getPublic());
    System.out.println(keyPair.getPrivate());
    } catch (NoSuchAlgorithmException e) {
    System.err.println(
    "errors");
    }

    suppose i want to showthe public & private keys in a text boxWhy? That is something that you would never do. A private key is private otherwise it is entirely without value.

  • Forms canvas width vs applet width

    Wondering why it is that a form with canvas/window defined as width 560 (real/pixel coordinate system) only fills 75% of the width of the applet (set to 572 in formsweb.cfg and confirmed thru browser at run-time). Running in 1900x1200 resolution; can someone guess at an explanation ?
    Using forms 10.1.2 now; wasn't having any trouble under 9i in lower resolutions.
    Many thanks.

    Thanks Simon.
    The absence of early feedback suggested it was something to do with my setup; and turned out to be the DPI setting on the Windows PC under Advanced Display. The PC was morphing what it thought to be unreadable content by increasing it by 25%. This was interacting not only with the fonts but also the size of the applet. Design-time pixel settings on window/canvas items weren't lining up with applet configuration parameters etc.
    Updating the DPI setting under Windows back to normal was all I needed.
    Thanks for your support.

  • Why isn't this box not resizing to browser width?

    my site is here: Home
    and a pic of the site:
    Why is that bottom gradation not spreading across the browser width? The top gradation spreads. The bottom dark blue box spread, but not the bottom gradation. I have it at 100% width, as I do with the other two that do spread. Perplexed.

    I experimented more with it. The lower gradation is a copy of the upper one then rotated 180 degrees. For whatever reason that copy wouldn't resize horizontally. So I deleted it and added a new box and filled it with my gradation and it worked.

  • Can you pin a horizontal menu widget to the sides of the browser so it resizes with browser width?

    Any ideas how I recreate the auto re-sizing of the horizontal menu bar depending on the size of the browser using muse that I've seen on the following site that I presume wasn't developed on Muse? http://www.thechequersbath.com/
    So far I've put a slideshow widget at 100% width, which creates the fixed slideshow in the background. I would love the menu to work in a similar way. Do I have to create a tablet version of it or what? Thanks for any feedback.

    Any ideas how I recreate the auto re-sizing of the horizontal menu bar depending on the size of the browser using muse that I've seen on the following site that I presume wasn't developed on Muse? http://www.thechequersbath.com/
    So far I've put a slideshow widget at 100% width, which creates the fixed slideshow in the background. I would love the menu to work in a similar way. Do I have to create a tablet version of it or what? Thanks for any feedback.

  • Components Resize Unexpectedly

    I have a window that uses borderlayout. The CENTER panel contains a table. The NORTH panel is in flowlayout. It contains 3 other panels that contains components. My problem is that occasionaly when the table becomes populated with data, the components in the north panel resize unexpectedly. This behavior is not desired. I have set the minimum sizes for the components, but that doesn't make a difference. Any suggestions or help would be appreciated. Thanks.
    Kevin

    Simple answer? Don't use flowlayout. ;o)
    Try using something like boxlayout, you can ensure that the north panel objects stay next to each other this way.

  • Resizing stage changes width of Ellipse

    When I adjust the stage size ellipses distort in scale seemingly. But the values for the shapes size remain the same.
    Why is this occurring?
    Is there a way to change the stage width without affecting the size of the ellipses?
    Thanks in advance for your help.

    How are you changing the stage size?
    And are the dimensions of stage as well as the elements on it are specified in % rather than px?
    hth,
    Vivekuma

  • JTable resizing the column width

    Have a JTable whose column width's are set using
    int width = ((String)getDataTbl().getColumnModel().getColumn(0).getHeaderValue()).length() + 32;
    getDataTbl().getColumnModel().getColumn(0).setPreferredWidth(width);
    int width1 = ((String)getDataTbl().getColumnModel().getColumn(1).getHeaderValue()).length()+207
    getDataTbl().getColumnModel().getColumn(1).setPreferredWidth(width1);
    Now depending on the data in column 1 the column width has to be increased if more than width1 and the scroll bar should apprear only in this case only?
    How to do this?
    Thanks.

    maybe you can implement a interface ComponentListener as well as ComponentAdapter with your topmost Table.
    for example:
    toptable.addComponentListener(
    new ComponentAdapter(){
    public void componentResized(ComponentEvent e){
    table1.setSize(....);
    table2.setSize(....);
    /*Optionally, you must also call function revalidate
    anywhere;*/
    );

Maybe you are looking for