Resizing canvas not working?

Hello all,
I'm a absolute beginner at flex and I have a slight problem
with resizing a control derrived of
Canvas (which is the child of another canvas).
Setting the height property does not seem to change its
internal height.
For example, if I have a canvas with height 400 and set the
height to 10, an click event handler will still fire if I click in
the region of the original canvas (with height 400). I would expect
the clickable region to change according to the new height.
Also, if I draw the background of an canvas within
updateDisplayList with
drawRoundRect, and reset the height, I would expect the
background (ie the canvas parent) to show/invalidate the part that
was previously occluded by the bigger canvas. This does not happen,
not even when I try to force an invalidation using
invalidateSize and/or
invalidateDisplayList.
What am I missing?
Thanks!
Ben
Included the code for a sample canvas:
package code
import mx.containers.Canvas;
import mx.events.*;
import flash.events.MouseEvent;
import mx.effects.*;
public class TestCanvasClass extends Canvas
public function TestCanvasClass() {
this.addEventListener(MouseEvent.CLICK, OnClick);
private function OnClick(e :MouseEvent) :void {
SlideIn();
public function SlideIn() :void {
this.height = 10;
override protected function updateDisplayList(w:Number,
h:Number):void {
super.updateDisplayList(w, h);
DrawBackground();
private function DrawBackground() :void {
this.drawRoundRect(0, 0, this.width, this.height, 8, 0, 1,
0, null, null, null);
which is in cluded in an mxml page like this:
<mx:Canvas width="100%" height="100%" label="Impressum"
showEffect="WipeDown" hideEffect="WipeUp">
<test:TestCanvasClass label="ffdsd" width="200"
height="100">
</test:TestCanvasClass>
</mx:Canvas>

Ok, just wondering how I would get this to work in the Game class?
I have a method that parses commands that get sent to it (from a console window):
private boolean parseInput(String cmd) {
     String[] tokens = cmd.split(" ");
     if(tokens[0].equalsIgnoreCase("show")) {
          frame.pack();
          frame.setVisible(true);
          return true;
     else if(tokens[0].equalsIgnoreCase("hide")) {
          frame.setVisible(false);
          return true;
     else if(tokens[0].equalsIgnoreCase("set") && tokens.length >= 3) {
          if(tokens[1].equals("scale")) {
               try {
                    int scale = Integer.parseInt(tokens[2]);
                    screen.setScale(scale);
               } catch(NumberFormatException e) {
                    System.out.println("Invalid scale.");
               frame.pack();
               return true;
          return false;
     return false;
}How can I make it work from there?
Edited by: KrimsonEagl on 6/06/2009 08:23

Similar Messages

  • Elements 10 canvas not working with tiff images; works fine with jpegs. What to do?

    Elements 10 canvas not working with tiff images; works fine with jpegs. What to do? It does not allow me to add a colored canvas, only a blank canvas.

    Perhaps some of the tiffs are already layers.
    In other words, since jpegs don't support layers, they all ways open with one locked background layer, but the tiff format does
    support layers so the tiffs don't have to have a locked background layer and can already be a regular layer that supports transparency.
    For the tiffs you could add a new color fill layer below and use the color you want the enlarged canvas to be.
    On pse 10 look at the bottom of the layers panel for the new adjustment of fill layer icon

  • Oracle Forms 10G(tabbed canvasses not working the same as in Forms 6i)

    Hi everyone,
    I have a form which gets called from another form through a list of value. The called form(second form) has a group of tabbed canvases which get displayed depending on the parameters passed from the first form.
    The Form is working prefectly fine in Forms 6i but when I converted the same form in to forms 10G it does not seem to work the same way. The tabbed canvasses are not getting displayed. I am manually having to press the execute query to get data displayed in the tabbed canvasses. I checked the parameters that are being passed and they are the same as that in Forms 6i.
    Please let me know where my 10G Form is going wrong. Appreciate your help, please send me an email on [email protected]
    Thanks

    duplicate
    Re: Oracle Forms 10G not working as Oracle Forms 6i

  • Pop up window resize disabled not working in fire fox (Linux)

    Hi all I am using Dreamweaver 8, with behavior I made a pop
    up window and disabled window resizing. It worked nicely in my
    windows XP system (I checked it in IE and Fire fox). But it is not
    working in Linux machine having same version of Fire fox
    browser(but worked correctly in IE on the same machine). In Linux
    machine we can simply resize the window.
    Does anybody give a solution to fix this problem?

    Post a link to the page, please.
    Why disable window resizing? What about those whose screen
    won't display
    the size you have picked?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "thozhayan" <[email protected]> wrote in
    message
    news:egpsde$s3r$[email protected]..
    > Hi all I am using Dreamweaver 8, with behavior I made a
    pop up window and
    > disabled window resizing. It worked nicely in my windows
    XP system (I
    > checked
    > it in IE and Fire fox). But it is not working in Linux
    machine having same
    > version of Fire fox browser(but worked correctly in IE
    on the same
    > machine). In
    > Linux machine we can simply resize the window.
    >
    > Does anybody give a solution to fix this problem?
    >
    >

  • Resize smaller not working for JTextArea

    I have a series of JTextAreas and JTextFields being added to a JPanel. The problem is I want them to always be the same size as the JPanel in the horizontal direction. This works fine for expanding the window, the JTextAreas and JTextFields expand with the panel to the edge, but then when I try to shrink the window the fields keep their maximum width as their width so when input is given to the field it does not word wrap until it has reached the edge of the maximum width rather than the current width.
    Here's the relevant code:
    JPanel rightSide = new JPanel();
           GridBagLayout gridBag = new GridBagLayout();
           GridBagConstraints constraints = new GridBagConstraints();
           rightSide.setLayout(gridBag);
           constraints.fill = GridBagConstraints.BOTH;
           rightSide.setBackground(BGCOLOR);
           Iterator iter = leafs.iterator();
           constraints.fill = GridBagConstraints.BOTH;
           constraints.weighty = 0.0;
           constraints.weightx = 1.0;
           constraints.gridwidth = GridBagConstraints.REMAINDER;
           while(iter.hasNext()){
             compare = (LeafItem)iter.next();
             textComponent =  compare.getComponent();
             //if the leaf needs a textArea put it in a scrollPane
             if(textComponent.getClass().equals(JScrollPane.class)){
               JLabel label = new JLabel(compare.getDescriptiveName());
               JTextArea textArea = new JTextArea();
               textArea.setLineWrap(true);
               textArea.setWrapStyleWord(true);
               if(HAS_BORDER)
              textArea.setBorder(blackline);
               gridBag.setConstraints(label, constraints);
               gridBag.setConstraints(textArea, constraints);         
               rightSide.add(label);
               rightSide.add(textArea);
             else{
               JLabel label = new JLabel(compare.getDescriptiveName());
               JTextField text = new JTextField();
               gridBag.setConstraints(label, constraints);
               gridBag.setConstraints(text, constraints);
               rightSide.add(label);
               rightSide.add(text);
           rightSide.setBorder
             (BorderFactory.createEmptyBorder(5, 10, 10, 10));
           JPanel remainder = new JPanel();
           remainder.setBackground(BGCOLOR);
           constraints.weighty = 1.0;
           constraints.weightx = 0.0;
           gridBag.setConstraints(remainder, constraints);
           rightSide.add(remainder);
           JScrollPane scrollPane = new JScrollPane
             (rightSide, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
              JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
           splitPane.setRightComponent(scrollPane);
         }

    I'm thinking it may be a bug with JSplitPane.Hm ... maybe our understanding of the JSplitPane is wrong in this context - I try to imagine, if it is normally needed, that components within one of this panes should be resized so that they fit the viewport. If I think about that, I have to say "normally not" - so, I guess, that is not a bug, it should be done in another way.
    Also I do not really understand, in which way you want them to be resized - if you shift the pane separator, the components should not be resized, or do you want them to be resized so that they fit the smaller viewport too?- And if you want them to resize, what if you hide one pane totally?-
    When asking myself this questions, it seems to me, that JSplitPane works correct the way it does it - the effect, you want, must be done in another way and also more specified, I guess.
    greetings Marsian

  • Dynamically add Canvas not working

    I have extended the Canvas class and i am trying to add it dynamically  to the stage, unfortunately it is not showing up.
    code from extended Canvas class;
    package com
    import mx.containers.Canvas;
    public class CustomCanvas extends Canvas
    public function CustomCanvas()
    super();
    protected override function updateDisplayList(unscaledWidth:Number,  unscaledHeight:Number):void
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    super.setStyle("borderStyle","solid");
    super.setStyle("cornerRadius",10);
    super.setStyle("backgroundColor","#FFFFFF");
    Here is the Flex code that is being used to initiate the Canvas;
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    cornerRadius="20"     
    creationComplete="init()" xmlns:com="com.*">
    <mx:Script>
    <![CDATA[
    import mx.flash.UIMovieClip;
    import mx.core.UIComponent;
    import mx.containers.Canvas;
    import com.CustomCanvas;          
    public function init():void
    var myCanvas:CustomCanvas = new CustomCanvas();
    addChild(myCanvas);
    myCanvas.x = 600;
    myCanvas.y = 200;
    myCanvas.width = 200;
    myCanvas.height = 200;
    ]]>
    </mx:Script>
    <com:CustomCanvas
    width="200"
    height="200"
    borderStyle="solid"
    cornerRadius="10"
    backgroundColor="#FFFFFF">
    </com:CustomCanvas>
    </mx:Application>
    Creating the Custom Canvas class via MXML works fine, but trying to  create it dynamically does not.
    Any thoughts ?

    i found a way to fix mine that maybe you could try.
    Look in your Profile Folder (go to this link to find out how to do that: http://kb.mozillazine.org/Profile_folder_-_Firefox#Finding_the_profile_folder )
    Now, delete these files but make sure Firefox isn't running when you do this:
    extensions.cache
    extensions.ini
    extensions.rdf
    Restart/open Firefox and they should work now.

  • [FB4/AIR] Resize transition not working during state change

    I am using a resize transition between two states.  The first time the state is changed the resize transition doesn&apos;t seem to execute, but merely jumps to the new size. The issue I am experiencing is similar to this  post - http://aralbalkan.com/2177. This is somewhat different as it&apos;s a title window and explicitWidth and explicitHeight are not available. Each subsequent time I change states during the same session, the transition plays fine, it&apos;s just that first initial state change.
    Any suggestions?
    Thanks.

    Moving to Flex forum http://forums.adobe.com/community/flex/flex_general_discussion

  • Resizable=true not working in window.open

    In window.open() in my jsp page
    window.open('http:/'+document.IPPBX_Form.ippbx.value,
    width=400,height=200,resizable=1
    have tried resizeable=true, resizable=true,resizeable=1,resizable=1
    but no hope. The maximizable button remains disabled.
    Help Please.
    Thanks in advance,
    Phani

    try this code.....
    <html>
    <script type="text/javascript">
    var WindowObjectReference; // global variable
    function openRequestedPopup()
    WindowObjectReference = window.open('http://www.google.com','DescriptiveWindowName','width=420,height=230,resizable,scrollbars=yes,status=1');
    </script>
    <body onload="javascript:openRequestedPopup();">
    hello world
    </body>
    </html>

  • Resize() of applet is not working properly in java6.0

    Hi iam new to applets i have given one task,that is to display multiple tiff pages in applet, So i have written one applet which displays multiple pages tiff file, i have kept next and previous buttons in the applet to navigate to different pages and here iam using resize() of applet for refreshing applet up to now all fine this all thing i have done in java5.0, but i got a requirement to do in java6.0, in java6.0 applet is not refeshing in the webpage.
    i found the reason that resize() is not working properly.
    Please can someone help me..........
    Thanks&Regards
    Manmohan A

    Dear Aravindth
      (.*?) means -> Select all contents from where you start and end,
    For Ex. <month>(.*?)</month> then Select for start <month> and end last </month> tag.
    (?) Match zero or one occurrences. Equivalent to {0,1}.
    (*) Match zero or more occurrences. Equivalent to {0,}.
    (+) Match one or more occurrences. Equivalent to {1,}.
    (.) (Dot). Match any character except newline or another Unicode line terminator.
    (.*?) means -> Zero or more times Match any character except newline or another Unicode line terminator + Match zero or more occurrences. Equivalent to {0,}.+Match zero or one occurrences. Equivalent to {0,1}.
    Could you please refere the below cite :
    http://www.javascriptkit.com/jsref/regexp.shtml
    Thanks & Regards
    T.R.Harihara SudhaN

  • AdvancedDataGrid column resizing not working.

    Flex sdk: 3.2
    Flash player: 10
    OS: Windows
    Browser: IE or FireFox
    I have an ADG for which column resizing does not work properly.   Unfortunately, I cannot create a standalone example that reproduces the problem.   The problem appears to be fairly straightforward: when the user drags the column to resize, the component appears to compute a delta that uses an incorrect combination of component and parent component X origins.   As a result, as the ADG is placed farther to the right, the error increases.
    I have tried the 3.5 and 4.1 sdks but encountered enough new compiler and startup errors that I gave up.
    I have developed a workaround by handling the mousedown and columnstretch events on my own.   I discovered that the event object coordinates seemed to be inconsistent and flat out wrong.  On the other hand, I found the ADG mousex coordinates to be more reliable.   On columnstretch, I then set the minWidth of the target column to my computed width  and it seems to fix the problem.   Actually, I don't understand why that would work.
    That said, is there a known problem with certain containment hierarchies that can create this situation.   I would prefer not to override builtin behavior unless I have to.   Is it possible that a styling skin could cause this (something I did not add to my standalone example)?   I noticed that a skin was the "target" (not "currenttarget" of the event).
    Thanks for any help,
    Ross

    Any one got any ideas?

  • LR 5.3 export with resize option not resizing

    Hello!
    Just updated my LR to 5.3 from the CC and noticed a weird problem that I never encountered before in LR4 or 5.x (before 5.3 that is).
    I usually export pictures from RAW format to either TIFF or JPG (100% quality) and depending on purpose I use batch resizing, e.g. 1080 pixels on short edge ... well that whole Resize setting gets ignored by LR 5.3! It still exports full size (full RAW size in this case) into JPG or TIFF, but it won't resize ... is it a bug or I am doing something wrong here?
    EDIT:
    I found out that I checked the "Don't enlarge" box in Export dialog under Resizing, that's when resizing was not working. After I unchecked it then it works fine, but still what does that have to do with anything if we are talking about downsampling images from 5184x3456 pixels to 1620x1080 ...

    It's a (reported) bug. Exportant provides a fix for it.

  • Batch Procedure Not Working For Image Resizing in Fireworks 8

    Scaling graphics with a batch process. You can alter the
    height and width of images being exported using the Scale option in
    the Batch Process dialog box. To set scaling options for
    batch-processed files:
    Select Scale from the Batch Options list and click Add. In
    the Scale pop-up menu, select an option:
    Scale to Fit Area makes images fit proportionally with the
    maximum width and height range you specify.
    If you have chosen either Scale to Size or Scale to Fit Area
    in the Scale pop-up menu, you can also choose to scale only
    those documents that are currently larger than the target
    size. To do so, select the Only Scale Documents Currently Larger
    Than Target Size option. Click Next to continue the batch
    process. For information on completing the batch process,
    This routine us not working as described: It is only
    modifying files larger than the dimension I wanted, whereas in the
    Fireworks MX, it would upsize smaller images to this requirement.
    Just FYI, we did not have the box checked to only apply to
    documents that are currently larger than the target size.
    IS THIS A BUG IN THE FIREWORKS 8 ???
    This is one of the primary reasons we use this software
    ALL RESPONSES WELCOME, ESPECIALLY ONE THAT WILL FIX THIS
    ISSUE !!!!
    JSEVonda

    I agree the option should not be there if it doesn't work.
    Quite
    honestly, I think the FW team missed it in the last upgrade.
    And you're talking about more than just scaling - you are
    most likely
    including an export command as well, this was not indicated
    in your
    original post. Keep in mind your scaling occurs BEFORE any
    saving of the
    file at any new optimization setting. Maintaining a low
    compression
    would help, yes, but I'm not referring to quality loss
    through
    compression, I'm referring to quality loss through data
    extrapolation
    (interpolation?). When you resample an image to a large pixel
    count, you
    are asking the software to use an algorithm to create pixel
    data that
    did not exist in the original file. Whether it's Photoshop or
    Fireworks,
    quality loss will happen in a bitmap file. In short, you're
    asking the
    software to make an educated guess about the data in these
    new pixels.
    As for your end results - you did not indicate the original
    size of your
    files (pixel dimensions), nor how much you are upsampling. If
    your
    files are not being upsampled too greatly, and/or there is a
    great deal
    of pixel data to begin with and/or the final upsized images
    are not
    really large then it's possible that you do not notice any
    significant
    loss in quality.
    My assumption was you were working with small files in terms
    of
    resolution. Generally, though, web images are not large to
    begin with
    and do not have a huge pixel count, so resizing them upwards
    would
    usually be noticeable.
    All I am pointing out is that the file would not have the
    same quality
    as the original, even if the option was working. Whether that
    difference
    in quality is noticeable . . .
    For example, I took an image that was 72 x 54 pixels, resized
    it 200 %
    to 144x108 pixels. Bigger image, but quality is low and
    noticeable.
    I do the same thing with a file that is 1024 x 768 and I can
    still see
    some loss, but it doesn't look quite as bad. IT is however,
    noticeably
    more blurry than the original.
    And now how about a possible FW solution? ;-)
    Open ONE file in FW
    Set your jpeg quality to 100 (Type the value, do NOT use the
    slider)
    Go to Modify > Transform > Numeric Transform
    Set your new image size to the desired dimensions
    Click OK
    Go to Modify > Canvas > Fit Canvas
    Find those three steps in the History panel and save it as a
    custom
    command.
    You will now be able to access this step in the Batch Process
    Wizard, in
    the Commands menu. or in the Commands menu in FW.
    Add your other batch steps. You do not need the export option
    because we
    set that up in the custom command, but you might want to use
    the Rename
    operation.
    Click Next
    Choose an export directory if you wish
    Save the script to create a complete custom command that
    handles both
    sizing and exporting and file renaming and a custom location
    for saving
    the file.
    This one script can then be used either from the Batch
    Process Wizard OR
    from the Commands Menu in FW.
    One note, if you choose a custom location for the files to be
    saved,
    that directory gets written into the command, so whenever the
    batch is
    run - that is where the new files will go.
    As for other programs, Photoshop comes to mind. I'm sure
    there are
    other, specialized batch processing programs out there which
    could do
    exactly what you want.
    HTH!
    Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    Extending Knowledge, Daily
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    news://forums.macromedia.com/macromedia.fireworks
    news://forums.macromedia.com/macromedia.dreamweaver
    JSEVonda wrote:
    > Well if that is the case, they should have notified the
    users to tell them, as
    > that is one of the primary reasons we even use the
    product. On that note, from
    > reading above replies, the upsampling did not degrade
    any image quality if you
    > simply chose "custom", as it allowed you to set the
    image quality to 100% of a
    > jpeg, during the batch routine, if you so desired.
    >
    > That said, what other product will do the task of
    "upsampling" as you call it,
    > in a batch format, as I do not want to have to go thru
    over 1000 images each
    > week and upsize them one at a time.
    >
    > JSEVonda
    >

  • Why table getWidth and setWidth is not working when resize column the table

    hi all,
    i want to know why the setWidth is not working in the following code,
    try to uncomment the code in columnMarginChanged method and run it wont resize the table.
    i cont set width(using setWidth) of the other table column using getWidth of the main table column.
    and i want to resize the right side columns only (you can check when you resize the any column the left and right side columns also resizing)
    any suggestions could be helpful.
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.TableColumnModelEvent;
    import javax.swing.event.TableColumnModelListener;
    import javax.swing.table.TableColumnModel;
    public class SynTableResize extends JFrame implements TableColumnModelListener, ActionListener
        JTable  table1       = new JTable(5, 5);
        JTable  table2       = new JTable(5, 5);
        JTable  table3       = new JTable(5, 5);
        JButton btn          = new JButton("refresh");
        JPanel  pnlcontainer = new JPanel();
        public SynTableResize()
            setLayout(new BorderLayout());
            pnlcontainer.setLayout(new BoxLayout(pnlcontainer, BoxLayout.Y_AXIS));
            pnlcontainer.add(table1.getTableHeader());
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table2);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table3);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            table1.getColumnModel().addColumnModelListener(this);
            table3.setColumnModel(table1.getColumnModel());
            table2.setColumnModel(table1.getColumnModel());
            table2.getColumnModel().addColumnModelListener(table1);
            table3.getColumnModel().addColumnModelListener(table1);
            btn.addActionListener(this);
            getContentPane().add(pnlcontainer, BorderLayout.CENTER);
            getContentPane().add(btn, BorderLayout.SOUTH);
            setSize(new Dimension(400, 400));
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] args)
            new SynTableResize();
        public void columnAdded(TableColumnModelEvent e)
        public void columnMarginChanged(ChangeEvent e)
            TableColumnModel tcm = table1.getColumnModel();
            int columns = tcm.getColumnCount();
            for (int i = 0; i < columns; i++)
                table2.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getWidth());
                table3.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getWidth());
                // the following commented code wont work.
    //            table2.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getPreferredWidth());
    //            table3.getColumnModel().getColumn(i).setPreferredWidth(tcm.getColumn(i).getPreferredWidth());
    //            table2.getColumnModel().getColumn(i).setWidth(tcm.getColumn(i).getWidth());
    //            table3.getColumnModel().getColumn(i).setWidth(tcm.getColumn(i).getWidth());
            SwingUtilities.invokeLater(new Runnable()
                public void run()
                    table2.revalidate();
                    table3.revalidate();
        public void columnMoved(TableColumnModelEvent e)
        public void columnRemoved(TableColumnModelEvent e)
        public void columnSelectionChanged(ListSelectionEvent e)
        public void actionPerformed(ActionEvent e)
            JTable table = new JTable(5, 5);
            table.setColumnModel(table1.getColumnModel());
            table.getColumnModel().addColumnModelListener(table1);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(table);
            pnlcontainer.validate();
            pnlcontainer.repaint();
    }thanks
    dayananda b v

    hi,
    thanks for your replay,
    yes i know that, you can check the following code it works fine.
    actually what i want is, when i resize table column it shold not automaticaly reszie when table resized and i dont want horizontal scroll bar, meaning that all table columns should resize with in the table size(say width 300)
    if i make table autoresize off than horizontal scroll bar will appear and the other columns moved and i want scroll to view other columns.
    please suggest me some way doing it, i tried with doLayout() no help,
    doLayout() method only can be used when table resizes. first off all i want to restrict table resizing with in the limited size
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.event.ChangeEvent;
    import javax.swing.table.TableColumnModel;
    public class TempSycnTable extends JFrame
        JTable  table1       = new JTable(5, 5);
        MyTable table2       = new MyTable(5, 5);
        MyTable table3       = new MyTable(5, 5);
        JPanel  pnlcontainer = new JPanel();
        public TempSycnTable()
            JScrollPane src2 = new JScrollPane(table2);
            JScrollPane src3 = new JScrollPane(table3);
    //        table1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        table2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        table3.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    //        src2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    //        src3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            table3.setColumnModel(table1.getColumnModel());
            table2.setColumnModel(table1.getColumnModel());
            table2.getColumnModel().addColumnModelListener(table1);
            table3.getColumnModel().addColumnModelListener(table1);
            table2.setTableHeader(null);
            table3.setTableHeader(null);
            setLayout(new BorderLayout());
            pnlcontainer.setLayout(new BoxLayout(pnlcontainer, BoxLayout.Y_AXIS));
            pnlcontainer.add(table1.getTableHeader());
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(src2);
            pnlcontainer.add(Box.createVerticalStrut(5));
            pnlcontainer.add(src3);
            getContentPane().add(pnlcontainer, BorderLayout.CENTER);
            setSize(new Dimension(300, 300));
            setVisible(true);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
        public static void main(String[] args)
            new TempSycnTable();
        class MyTable extends JTable
            public MyTable()
                super();
            public MyTable(int numRows, int numColumns)
                super(numRows, numColumns);
            public void columnMarginChanged(ChangeEvent event)
                final TableColumnModel eventModel = table1.getColumnModel();
                final TableColumnModel thisModel = getColumnModel();
                final int columnCount = eventModel.getColumnCount();
                for (int i = 0; i < columnCount; i++)
                    thisModel.getColumn(i).setWidth(eventModel.getColumn(i).getWidth());
                repaint();
    }thanks
    daya

  • Resizing image using CSS - not working in IE

    Hello,
    I have a standard report with couple of columns one of which a image column. The images are of varying sizes and I manged to resize them to a fixed width & height by using CSS code in page header as below:
    td[headers="ITEM_PICTURE"] img {
      display: block;
      width: 70px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }The CSS does the trick in Chrome & Firefox but does not work in internet explorer. Is there a way to make this CSS code IE friendly?
    Cheers for help.

    William Wallace wrote:
    I am using Apex 4.2.1 (had this issue in 4.1.1 as well) and using theme 10.Ah, the Sludge Sand theme. In 4.x that's a legacy theme only really included to allow applications to run on IE6. It's therefore intended to run in quirks mode, meaning in Internet Explorer terms there's no support for anything that didn't work in IE6 (for certain values of "work"). This means no CSS3, no support for a lot of useful CSS2.1 stuff (like attribute selectors), and probably problems with jQuery which requires standards mode. Adding a DOCTYPE to the page templates to trigger standards mode Interactive Report: how can I display carriage returns?. In 4.2 you really should switch to one of the latest Standard themes, or at least one of the standards mode Legacy themes (those not marked with a "*").
    If you must use theme 10, and there are no other images in this report (like edit icons) then you could add a static ID to the region and use a more basic selector like:
    #static-id td.t10data img {
      display: block;
      width: 70px;
      border: 1px solid #999;
      padding: 4px;
      background: #f6f6f6;
    }However, it appears that one of IE's quirkier quirks mode quirks is that CSS padding is not supported on images, so the presentation you want is not possible using theme 10 in IE and CSS alone.
    Switching to a modern theme is recommended.
    Edited by: fac586 on 02-Mar-2013 10:31

  • Dynamic resizing in JDialog using setSize not working properly on solaris

    can anyone help..
    Dynamic resizing in JDialog using setSize is not working properly on solaris, its work fine on windows.
    i have set Jdialog size to setSize(768,364),
    when i dynamically resizing it to setSize(768,575); it doesn't get change but when i move dialog using mouse it gets refreshed.
    this problem is only happening on solaris not on windows.

    Hi,
    It's only an approach but try a call of validate() or repaint() after re-setting the size of your dialog.
    Cheers, Mathias

Maybe you are looking for

  • Sync Mac Address Book - multiple Google accounts

    I hope this is the right place for this question. I understand that you can sync the Mac Address Book with Google accounts, but is there a way to sync that Mac Address Book with MULTIPLE Google accounts. Our scenario is that we have one iMac as our m

  • Creating Source systems in two same logical BW systems from single R/3 sys

    Hi All, We are facing an issue while creating Source systems in two same logical BW systems, from single R/3 systems. Our Basis team is telling that if we want to connect the single R/3 system into 2 BW systems with same logical name, we will need to

  • Rectangular Marquee Tool is a solid line

    The Rectangular Marquee Tool in CS4 has started using a solid line instead of the usual dotted line. Is there some setting to revert to the dotted line somewhere, or has my software just gone haywire? Feather is 0px and Style is Normal.

  • UNION operator with BULK COLLECT for a collection type

    Hi all, I created a table type as below: create or replace type coltest is table of number; Below are 3 PL/SQL blocks that populate data into variables of the above mentioned table type: BLOCK 1: DECLARE col1 coltest := coltest(1, 2, 3, 4, 5, 11); co

  • Help identifying a powerbook model

    hi there could someone help me identify a powerbook for me i found on ebay the ad says its a 12 inch but i can tell it isnt because i already own a 12 inch g4 and can somebody tell me what year and screen size it is please? http://www.ebay.co.uk/itm/