JScrollPane dynamic size

I have JscrollPane on that I am placing some JGraph symbols.When I drag that symbol towards right and down side of scrollpane,horizontal or/and vertical scroll bar appears.But when I drag symbol towards left and up side of scrollpane,scrollbar doesn't appear and that symbol hides.Symbol is present on the screen but I am not able to see it because scrollbar doesn't appear.
Anybody have solution for this?Or Is that bug in JScrollPane?
Thanks.

Reposted verbatim from
[http://forums.sun.com/thread.jspa?threadID=5364807]
completely ignoring Maxideon's response on that thread.
db

Similar Messages

  • How to crate a dynamic size array, collection

    Hi,
    Can someone point me to some tutorial on how to create a dynamic size array. Actually I have multiple cursors and on different tables and want to loop through each cursor and get some values from each cursor and put it in an array. But don't know how to create or initialize an array as I don't know the size. Is there any other way.
    Here is what I am doing I have 6 cursors on different tables, I loop through each cursor and get some specific data that I need to place at one place after looping through all the cursors which then finally needs to be inserted in one table. But before the insert I need to validate each data so want to have all the data in some array or some other place for temporary storage from it's easier to do the validate and insert rather than while looping through the cursors as there may be duplicates which I am trying to remove.
    As this procedure will be called multiple times so wanted to save the cursor data in temporary array before inserting in the final table. Looking for some faster and efficient way.
    Any help is appreciated.
    Thanks

    guest0012 wrote:
    All the 6 cursors are independent and no relation i.e. can have a join and have one sql as no relationship in tables.If there is no relation, then what are your code doing combining unrelated rows into the same GTT/array?
    Now using GTT when I do an insert how do I make sure the same data doesnot already exists. i.e. GTT will only have one column. Then create a unique index or primary key for the GTT and use that to enforce uniqueness.
    So everytime I iterate over a cursor I have to insert into GTT and then finally again have to iterate over GTT and then do an insert in the final table which maybe a performance issue Which is why using SQL will be faster and more scalable - and if PL/SQL code/logic can be used to glue these "no relationship" tables together, why can't that not be done in SQL?
    that's why i was wondering if can use any kind of array or collection as it will be a collection of numbersAnd that will reside in expensive PGA memory. Which means a limit on the size of the collection/array you can safely create without impacting server performance, or even cause a server crash by exhausting all virtual memory and causing swap space to trash.
    and finally will just iterate ovr array and use FOR ALL for insert but don't know what will be the size of the array as I only know after looping the cursors the total number of records to be stored. So wondering if how to do it through collection/array is there a way to intialize the array and keep populating it with the data with defining the size before hand.You cannot append the bulk collect of one cursor into the collection used for bulk collecting another cursor.
    Collections are automatically sized to the number of rows fetched. If you want to manually size collection, the Extend() method needs to be used, where the method's argument specifies the number of cells/locations to add to the collection.
    From what you describe about the issue you have - collections are not the correct choice. If you are going to put the different tables's data into the same collection, then you can also combine those tables's data using a single SQL projection (via a UNION for example).
    And doing the data crunching side in SQL is always superior in scalability and performance, than doing it in PL/SQL.

  • Dynamically size movieclip to fit text's string height and width

    Hello,
    I am trying to dynamically size a movieclip to fit the size of a text's string height and width (This text is inside the movieclip)
    here is my code so far..
    var Font1_ = new Font1();
    var Format2:TextFormat = new TextFormat();
    Format2.size = 36;
    Format2.align = TextFormatAlign.CENTER;
    Format2.font = Font1_.fontName;
    var MessageBox:MovieClip = new MessageBoxMC();
    MessageBox.Text1.defaultTextFormat = Format2;
    MessageBox.Text1.embedFonts = true;
    MessageBox.Text1.antiAliasType = AntiAliasType.ADVANCED;
    MessageBox.Text1.wordWrap = true;
    MessageBox.Text1.width = 800;
    MessageBox.Text1.height = 400;
    MessageBox.Text1.textColor = 0xFFFFFF;
    MessageBox.Text1.cacheAsBitmap = true;
    MessageBox.Text1.mouseEnabled = false;
    MessageBox.Text1.text = String("Use the Arrow Buttons to move");
    MessageBox.width = MessageBox.Text1.width;
    MessageBox.height = MessageBox.Text1.height;
      MessageBox.x = 400;
      MessageBox.y = 200;
      addChild(MessageBox);
    this isn't working for me.. anyone know the best way to do this?
    I also want the text to be centered in the movieclip, with a border of around 2-4 pixels
    I am also not sure if i should be using text.length? any advice and input is greatly welcomed.
    thanks in advance!

    Essentially, you need to check for a change in .textWidth or .textHeight, which are different from .width and .height.
    This code works for me (assumes a background box called bg and a foreground text instance fg inside a moveclip and an X and Y bounds offset variable to say how far away you want the box from the text and a textFrameNudge to provide a tweak value).
         // Resize background box
         thisBox.bg.x = thisBox.fg.x - boundsOffsetX + textFrameNudge; // I'm using .4 as the tweak value for textFrameNudge
         thisBox.bg.y = thisBox.fg.y - boundsOffsetY;
         thisBox.bg.width = thisBox.fg.textWidth + boundsOffsetX*2 +textFrameNudge*thisBox.fg.getTextFormat().size;
         thisBox.bg.height = thisBox.fg.textHeight + boundsOffsetY*2;

  • JScrollPane + Component sizes before display

    I was recently presented with a minor quandry.
    I have a JPanel which needs to occupy a minimum fixed amount of real estate on my application's GUI, call it 'checkbox_jpanel'. The problem is that as the user operates the application, more and more checkboxes will be added to it. This works fine until I reach the size limit of the JPanel.
    The obvious solution seemed to be to use a JScrollPane, and simply tuck the checkbox_jpanel inside of it. That way, I could dynamically resize the JPanel, and the JScrollPane could take care of displaying it.
    Simple, until I realized that there's no good way to ask a layout manager how much space it had planned to let a given component take up, including buffer pixels. I can't even ask the component itself because, having not yet been drawn, it doesn't know how big it is either.
    Currently, I'm able to get this strategy to work by guessing - eyeballing the number of pixels + space - each new checkbox takes up for the height * the number of items, and the width is based on the largest constant + (constant-intended-to-represent-average-character-width*letters in text portion of checkbox) among the set of checkboxes. I use that width and height to set the preferredSize of the JPanel i'm actually adding to.
    I wince when I look at that code.
    The comment above it says "This really needs to be done correctly."
    How could I do this 'correctly' ?
    The only thing I've been able to come up with is almost as ugly; make the checkbox_jpanel some insanely large size that will always encompass EVERYTHING, insuring that the checkboxes will be drawn, force/wait for the redraw, and then recalculate the width/height, and reset the panel to the desired (correct) width and height. I don't know if I could get this done without a bit of flickering, and really, everything about it screams 'non-optimal solution'.
    Any thoughts?

    Just an idea: the sizes become calculated when the components become visible OR when the application frame is packed... perhaps you could use a call to pack(), then do your job, then finally show your frame ?

  • JTable in JScrollPane, preferred size

    When I put a JTable in a JScrollPane, the JScrollPane seems to want to be very big. How does the scroll pane determine its size? run this code for an example..
    import javax.swing.*;
    public class TestPanel extends JPanel
    public TestPanel()
         add(new JScrollPane(new JTable(1,1)));
    public static void main(String args[])
         JFrame f = new JFrame("big table test");
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         TestPanel thePanel = new TestPanel();
         f.setContentPane(thePanel);
         f.pack();
         f.show();

    public class TestPanel extends JPanel {
      public TestPanel() {
        JTable jt = new JTable(1,1);
        jt.setPreferredScrollableViewportSize(new Dimension(100,100));  // Do this
        JScrollPane jsp = new JScrollPane(jt);
        jsp.setPreferredSize(new Dimension(100,100));  //OR this
        add(new JScrollPane(new JTable(1,1)));
    }

  • Dynamic size of column header

    How do I make the header row of a column in a Jtable to dynamically adjust it's size to it's contents??
    Need this
    |HEADER COL1||HEADER COL2.....|H C3|
    Have this
    |HEADER C||HEADER C|H C3|
    Thanks!

    You need to get the column model and each column in turn and then set the width there.

  • Dynamic size box in Java 3D

    Hi,
    I have two problems regarding the dynamic box in java 3D:
    1. how can I change size of the box during runtime? I want to draw a 3D bar chart like using box.
    2. what is "Exception in thread "AWT-EventQueue-0" javax.media.j3d.BadTransformException: TransformGroup: non-affine transform"? I encountered this when using a percentage (a value / max value) to create a box.
    below is my portion of code:
    I have methods to set the propValue, maxValue, sideX and sideZ. I update these values using setter to change the Box, but I think I need to have one more method to update the box (calling createSceneGraph() ).
    protected Group createSceneGraph()
    visualRep = new BranchGroup();
    float scaleFact = 1.0f; // scaleFact is used only for debugging purpose
    float percentage = propValue / maxValue;
    // I want to move the height to half of its height, they are different for each
    // module since the height is affected by the percentage. But, every time I add
    // percentage to the "itsHeight", it gives me error : Exception in thread
    // "AWT-EventQueue-0" javax.media.j3d.BadTransformException:
    // TransformGroup: non-affine transform
    //float itsHeight = ( HEIGHT * percentage );
    float itsHeight = ( HEIGHT );
    // 1. Create the box
    Box vis = new Box(
    sideX * percentage * scaleFact,
    itsHeight * scaleFact,
    sideZ * percentage * scaleFact,
    Box.GENERATE_NORMALS,
    LCMPlanning.getInstance().getAppearance( this.getModule(),
    LCMPhysical.DEFAULT_WALL ) );
    vis.setCapability( Box.ENABLE_APPEARANCE_MODIFY );
    // 2. Move the first box to the top of the ground level
    Transform3D t3d = new Transform3D();
    t3d.setTranslation( new Vector3f( 0.0f, itsHeight, 0.0f ) );
    TransformGroup tg = new TransformGroup( t3d );
    tg.addChild( vis );
    tg.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );
    visualRep.addChild( tg );
    return visualRep;
    thanks a lot.
    Daniel

    Hi,
    Nobody answered your questions so far? Here's my take.
    Changing the size of the box at runtime:
    The easiest way to do that is to scale the transform using transformName.set(double scale) or transformName.setScale(double scale).
    Non-affine transform error:
    I get this error every once in a while. With me it happens when I try to assign a value of infinity or a NaN (not a number) to one of the params in the transform. I suggest printing the params you are using to create the box.
    sideX * percentage * scaleFact,
    itsHeight * scaleFact,
    sideZ * percentage * scaleFact,
    You may not be specifying what you think you are specifying.
    Hope that helps.

  • JLists, JScrollPanes different size when empty than when populate

    I have a JList which is inside of a JScrollpane, which is inside of a panel who's layout is controlled with a GridBagLayout.
    When I first start my program, and the JList is empty, the JList is the size I want. The GridBagLayout is set to fill both directions for the JList.
    However, when I add an item to the JList, the GridBagLayout resizes the cell that the JList is inside of just slightly. How can I prevent this? It is obnoxious to use the program when the all the items on the screen change size a little bit when a JList goes empty as opposed to when it is populate.
    Why does a JList (inside of a scrollpane) get a different size assigned to it by the grid bag layout when it is empty, as to when it has items in it?

    Setting the preferred size on the scroll pane containing the list corrects 1/2 of my problem - The vertical space alloted by the grid bag layout no longer changes with an empty list compared to a populated list.
    I'll give the first guy a couple of points.
    The rest of the points are still up for grabs ----
    I still have problems with side by side lists which have items that can be moved back and forth.
    I tried setting min size and preferred size on the scroll panes.
    I tried putting each scroll pane into its own JPanel that had a Grid Layout, and then added the panels to my main panel with a grid bag layout, and weights set to .5 for horizontal expansion.
    I even tried putting min, preferred, and max sizes on these panels.
    I still cannot make the grid bag layout alot equal space to the left and right scroll panes.
    Is there any way that I can get the space alloted between my components to be roughly
    ====================
    || 45% || 5% || 45% ||
    || JList || buttons || JList ||
    ====================
    Ane then have only the outside two columns change size when the window is resized (in equal proportion)???

  • Adding dynamic size table to Interactive Form

    Hello everyone,
    I have a node with multiple elements that i would like to show in an interactive pdf form.
    I'm using the Adobe LiveCycle Designer to do it, but i'm only managing to bind "solo" variables, not tables.
    How can i associate dynamically a table with several lines to a pdf interactive form ? I tried a list box but i still only get the first element shown in the box. Am i doing anything wrong ?
                 Thank you in advance.
                           Nuno Santos

    Hi,
    Basically the general way to add a table to INteractive form is by adding a subform elemet to a subform element and(i mean subform in a subform), now map the fields u want to be displayed as a table.
    For the fisrt subform set the LayoutType-Flow Content,Flow DirectionTable.
    Then select the allow page breaks within the content option.
    And the binding should be Normal.
    for the second subform:
    LayoutType-Flow Content,Flow DirectionTable row.
    Now also select the option allow page breaks.
    Then for Binding tab: select the Repeat Subform for each data Item, then min count=1.
    And now if ur table columns contain names like abc, def and xyz.
    Then in the script editor code something like this
    abc[*]; under show: initilaze, language: Formcalc and Run at: client
    Hope this should work out for you.
    let me know if u have any more queries.
    Thanks,
    Lohi

  • JScrollPane viewport size question

    Hi all,
    I've a component that is very large (it has a dinamic height) but its width is always the same (fixed). I need to show this component in a JScrollPane container and only shows the vertical scrollbar. It works fine but when my applications runs, the component inside the JScrollPane (yes..my component) get a different width, which is larger than the original componet's width
    I'm using the following code:
            JScrollPane scroll = new JScrollPane(myComponent);
            scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);My question is, How I can do for set a fixed width to the JScrollPane (its viewport or its child component) in order to get the correct component width and only allows a dinamic height ?
    thanks in advance

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Random;
    public class Test3 extends JFrame {
      JPanel jp = new JPanel();
      JScrollPane jsp = new JScrollPane(jp);
      JLabel jl = new JLabel("", JLabel.CENTER);
      Random rand = new Random();
      public Test3(){
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        content.add(jl, BorderLayout.NORTH);
        jp.setBorder(BorderFactory.createLineBorder(Color.blue));
        jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        jsp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        content.add(jsp, BorderLayout.CENTER);
        JButton jb = new JButton("Random Height");
        content.add(jb, BorderLayout.SOUTH);
        jb.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            int height = rand.nextInt(1000);
            jp.setPreferredSize(new Dimension(jsp.getViewport().getWidth(),height));
            jsp.getViewport().revalidate();
            jl.setText(""+height);
        setSize(300,300);
      public static void main(String[] args) {new Test3().setVisible(true); }
    }

  • Multi-dimensional array with dynamic size - how to?

    Hi
    I have a CONSTANT number of buckets. Each of them has to take a VARIOUS number of data series. The data series have one VARIOUS length per bucket. I'd like to index the buckets like an array to loop over them.
    So basically I need something like a multidimensional array with constant first dimension (bucket index), but dynamic second (data series index within bucket) and third (data point index within data series) dimension. What's the best way to do so?
    I should also remark that data series can get really big.
    Thanks in advance and best regards,
    Michael

    Hi Michael,
    the usual way is to use an array of cluster.
    Put your "2nd" and "3rd" data into a cluster and then make an 1D array of that cluster...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Dynamically Size a div ?

    Hello~
    I have a CSS-based navigation bar that is populated from a database. Right now, I am hard-coding the width of each button (using a 1-image as a repeating background) in the CSS file, but I was wondering if anyone had an idea of how to set that div width for each button based on how many links are found in the database? FOr example, the containing div is 710 pixels wide, and right now I have 6 divs that contain a nav button and link, but they are each hard-coded to be 116 pixels wide. If I change the number of links in the database, I will have to change the CSS code as well. I would love to find a way around this! Thanks for any suggestions!
    KC

    Ummm...  Use a CFML variable to define the desired width of the div.  Use whatever logic you want to calculate the value of that variable?
    This is no different then dynamically generating any other content to send to a client browser.
    The only gotcha there maybe here is if you have all your CSS seperated into a css file.  This is, of course, because a CSS file is not normally passed to ColdFusion by a web browser for processing of dynamic content.
    You have several choices on how to handle this.
    1) Include a small portion of the CSS in the regular CFM file.  You do not need to include all your css, just the part you want to make dynamic.
    2) Make your CSS file a CFM file.  There is nothing illeagal about naming your css file something like 'myCSS.cfm'.  And then linking to that in your HTML content.  This file will then be process by ColdFusion.  This can cause issues where a browser may or may not cache a dynamic cfm file the same as it would a static css file loosing some of the benifit of seperating the style content.  This can be mitigated by providing the proper headers to the css content with <cfheader...> tags so that the browser will cache the content as desired.
    3) Configure your system to pass css files to ColdFusion for processing.  This has the same caching issues with nameing your file with a cfm extension with the same solution.  It also has the added benifit that your files will have a normal css extension so that many editors will knwo how to propelry highlight and code hint the file that often does not work correctly with files ending in cfm.  But it can lead to uncessary server load if little of the CSS is dynamic as well as will not be allowed with most shared hosting providers.

  • Picture with dynamic size?

    Hello,
    I post a Picture (OLE) on an CR Page. Depending on the parameters in the report, differnt pictures with different Sizes are selected. Now I want to fix the maximal hight and width of the space I reserve for the picture but keep the ratio between hight and width of the original. How can i do this?

    To achieve
    "Depending on the parameters in the report, differnt pictures with different Sizes are selected."
    Use conditional hiding in sections or in object hiding. Formula you can write.
    Right click any object  and select 'size and position'. There also you can write formula .
    or
    format the object you can find hieght widht write formula to meet the requirement.
    Regards
    Usma

  • Dynamic size

    hello here is my code ...
    db[] dbapp = new db[];
    compile:
    [javac] Compiling 12 source files to D:\PADMA\work\APPLIC~1\PRINTING\SOURCE~
    1\build
    [javac] D:\PADMA\work\APPLIC~1\PRINTING\SOURCE~1\Source\DbController.java:15
    6: array dimension missing
    [javac] DbApplication[] dbapp = new DbApplication[];
    here my db array may be dynamically changes.... so how would declare the array
    plz help me asap

    but plz write a code for that.... here i am unable to initialise the array
    DbApplication[] dbapp = new DbApplication[];
    here compiler is asking for dimension.... but i do not want to provide the dimension since it will change dynamically....
    plz asap

  • How to have dynamic size of the content area

    Hello everyone
    I am trying to create a printable adobe form using Adobe LiveCycleDesiner 8.
    Here is my problem.
    The PageMaster is containing the company Logo, Address and the ship to address.
    The ship to address can be composed by up to 11 lines. Those lines are not always used. Some addresses have only 5 lines.
    If I am reserving those 11 lines before the content area, we are loosing alot of space that can be used for the body page.
    So the question is:
    Is it possible to have a flowed content area? Where the size of the content area would be driven by the available space of the PageMaster?
    Regards
    stjacqd

    Hello Carsten
    The subform has no impact to the content area size.
    The subform has an impact only inside the content area or inside another  form.
    My point is:
    PageMaster
    |  Logo                                          |
    | Address1                   Address      |
    | Address2                   Address      |
    | Address3                   Address      |
    | Address4                   Address      |
    | Address5                   Address      |
    | Address6                   Address      |
    | Address7                   Address      |
    | Address8                   Address      |
    | Address9                   Address      |
    | Address10                 Address      |
    | Address11                 Address      |
    |---------------------------------------------------|
    | Content area                               |
    |                                                   |
    So, inside the Page Master there is 11 lines reserved for the addresses,
    But at the printout, if there are only 3 lines used for the address, I would like to reassign the space used by the address4 through adderss11 to the content area.
    So the result at printout will look like:
    |  Logo                                          |
    | Address1                   Address      |
    | Address2                   Address      |
    | Address3                   Address      |
    |---------------------------------------------------|
    | Content area                               |
    |                                                   |
    Instead of:
    |  Logo                                          |
    | Address1                   Address     |
    | Address2                   Address     |
    | Address3                   Address     |
    |                                                   |
    |                                                   |
    |                                                   |
    |                                                   |
    |                                                   |
    |                                                   |
    |                                                   |
    |                                                   |
    |---------------------------------------------------|
    | Content area                               |
    |                                                   |
    Regards

Maybe you are looking for

  • How can I use zoom while recording on my iPhone 4S?

    How can I use zoom while recording on my iPhone 4S?

  • How to use a java class in difference project under a same workspace!

    Hi, there: I have a problem. I want to reuse a java class which is located in another project of the same workspace. I do not know how to set the two project setting or how to import the java class. I deeply appreciate. Sheng-He

  • QT 7.0.4 Install Doesnt Work Correctly on MAC OS 10.3.9

    I dloaded QT 7.0.4 and installed it on a 1.25 mHz Dual Processor G4 MAC computer with 1.5 GIGS of RAM frunning MAC OS 10.3.9. I typed in the Pro Serial Number. When I click on either previously made in QT 6.5.2 movies or movies exported from SoundTra

  • AE does not show up in Airport Utility

    Hello, As a disclaimer, I know next to nothing about wireless networks. Here is what I have: 2 G5 towers and MBP. Tower is NOT wireless. Cable comes in and goes to modem > modem to Airport Base Station > to D-Link Router. All computers have a direct

  • EM17 JOURNAL IMPORT ERROR

    Hi I tried to run TRANSFER JOURNAL ENTRIER TO GL but i got the following error EM17 Sequential numbering is always used and there is no assignment for this ledger and journal entry category.I set the sequential numbering for Payables Site as Always u