Problem With a Canvas Pane.

Hello.
I need implement a Print Preview for my application, and I use a Canvas Pane for perform the custom painting.
Everything works very well, with the exception that the canvas, is drawing outside of the bounds of the scrool panel who contains it. My question is, How I maintain my canvas, within the pane who contains it?
My code is:
     public static void myPreview() {
          createPreview(); // Here is where I create the canvas ans perform custom painting.
          // For centering the canvas.
          JPanel myPane = new JPanel(new FlowLayout());
          myPane.setBackground(Color.GRAY);
          myPane.add(new JScrollPane(myCanvas));
          previewPane.add(myPane);
          previewPane.setVisible(true);
     }Best Regards
Manuel
Mensaje editado por:
MacManolin
Mensaje editado por:
MacManolin

I tried that but then it slows down all actions.For example,clicking and dragging actions become very slow.Even opening a JDialog takes a long time.
RS

Similar Messages

  • Problem with Stacked Canvas

    Hi,
    I have prepared a stacked canvas on a content canvas.
    Both content and stacked canvas are based on the same data block. In the data block 2 items are on content canvas and the remaining are on stacked canvas. I have also a scroll bar on the content canvas so that we can scroll to the right as there are many items on it.
    so 1st and 2nd fields are on the content canvas and remaining ones are on stacked canvas.when i tab out of the 1st field stacked canvas goes invisible, but when i tab out of the 2nd field stacked canvas again comes back.
    How can i avoid this?
    I want the stacked canvas always to be displayed when i tab out from any where.
    One more problem is, when i click on the 2nd field the stacked canvas goes invisible too
    Your suggestions are greatly appreciated.
    Thanks
    Sandeep

    Check if the second item overlaps the area of the stacked canvas. Forms always makes the current item be displayed fully and therefore hides all areas which would overlap the item.

  • Simple Problem with Stacked Canvas, I hope

    Hello all,
    I am become a bit frustrated with what I thought would be a simple form development solution. I am trying to create a form with a stacked canvas that will display about 20 fields that can be scrolled through. This is the detail
    Total of 25 fields
    5 Fields on the content canvas
    20 Fields on the stacked canvas
    I created the first canvas that originally contained all 25 fields. Then I created the stacked canvas and moved the appropriate fields to the stacked canvas. Using the forms builder editor, I positioned my stacked canvas as such so that it would not overlap the last field on the content canvas or visa versa. This is a form being developed for Oracle EBus. Whenever I run the form in the apps, the stacked canvas is not visible. It only becomes visible when the 1st field on the canvas has focus. When the stacked canvas becomes visible, it shows all of the items of the stacked canvas and not just the ones that I included in the viewpoint. Once I tab through the last field of the stacked canvas, it goes back to the first field on the content canvas and the stacked canvas disappears. At this point I am not doing anything complicated, but for whatever reason this just is NOT working. Any advice anyone can provide, I would very much appreciate it. This is VERY frustrating.
    Thank you in advance.

    Step No. 1
    Set the STACKED CANVAS's property VIEWPORT WIDTH AND VIEWPORT HEIGHT
    This property determines what viewable width and height of the stacked canvas at runtime.
    Set SHOW HORIZONTAL SCROLL BAR or SHOW VERTICAL SCROLL BAR or BOTH as YES so that you can scroll down to view all the items in the CANVAS.
    Step NO.2
    In your WHEN-NEW-FORM-INSTANCE trigger, write the code to make the canvas visible
    SHOW_VIEW('stack_canvas_name');

  • 'Easy Set-up' Option - Problem with edit canvas/windows - really need help!

    Hello Everyone. . .
    Have a problem that i really need help with, i have tried so many different things to sort this - but with no sucess.
    I usually work in High Definition and i have recently done a small project for someone in DV. When changing to work in DV, i selected the DV setup from the 'Easy Setup' menu. I have now changed back to HD and there are a few things different with Final Cut that i can't shift!
    When i move a clip from the capture bin into the edit window, the clip no longer fills that window like it always used to and there are lines at the top and the bottom of the clip - almost like it is in widescreen.
    Editing like this wasn't too much of a problem, but when i came to compress and do a final render of the whole film - there was the same black lines on the top and bottom of the film.
    I can't figure out how to get the setting back to how they were, and have the clips fill the edit windows and fix the end render/compress.
    Any ideas from anyone on what i am experiancing with all this? And. . . how to fix this problem?
    Any help on all this will be very much appreciated!

    Hello Everyone. . .
    Have a problem that i really need help with, i have tried so many different things to sort this - but with no sucess.
    I usually work in High Definition and i have recently done a small project for someone in DV. When changing to work in DV, i selected the DV setup from the 'Easy Setup' menu. I have now changed back to HD and there are a few things different with Final Cut that i can't shift!
    When i move a clip from the capture bin into the edit window, the clip no longer fills that window like it always used to and there are lines at the top and the bottom of the clip - almost like it is in widescreen.
    Editing like this wasn't too much of a problem, but when i came to compress and do a final render of the whole film - there was the same black lines on the top and bottom of the film.
    I can't figure out how to get the setting back to how they were, and have the clips fill the edit windows and fix the end render/compress.
    Any ideas from anyone on what i am experiancing with all this? And. . . how to fix this problem?
    Any help on all this will be very much appreciated!

  • Very basic problem with a Canvas and JScrollPane

    Ok, I'm making this software, with a lot of graphics, and as usual I start all classes alone to see them work and then I put them together in one nice JFrame with MenuBar and so on... but something strange (to me) happened when I made a JScrollPane with some of the Canvas because I couldn't make them for 1024x768 because of its contents.... so I add this JScrollPane to the TabbedPane as a new tab, so I have in my JFrame: the menubar, the tabbedpane and the canvas with a vertical scrollbar in the right, BUT, when I scroll down, the Canvas starts to scroll over the tabbedpane and the menubar!
    very wierd to me, I know one must try to not use scrollbars, but I really need this to work this way!
    thanks!!
    help!!
    Message was edited by:
    Reinaldo_Matte

    Ok, I'm making this software, with a lot of graphics,
    and as usual I start all classes alone to see them
    work and then I put them together in one nice JFrame
    with MenuBar and so on... but something strange (to
    me) happened when I made a JScrollPane with some of
    the Canvas because I couldn't make them for 1024x768
    because of its contents.... so I add this JScrollPane
    to the TabbedPane as a new tab, so I have in my
    JFrame: the menubar, the tabbedpane and the canvas
    with a vertical scrollbar in the right, BUT, when I
    scroll down, the Canvas starts to scroll over the
    tabbedpane and the menubar!
    very wierd to me, I know one must try to not use
    scrollbars, but I really need this to work this way!
    thanks!!
    help!!Don't mix heavyweight(AWT) components such as Canvas, with lightweight (Swing) components.
    See:
    http://java.sun.com/products/jfc/tsc/articles/mixing/
    and
    http://java.sun.com/products/jfc/tsc/articles/painting/index.html

  • Problem with my Canvas Viewer

    Never had this problem before in over 8 years of Final cut editing...
    No images appear in my canvas viewer when I am editing! The canvas viewer is there, but no images appear when the playback is idol.
    Obviously this is pain in the neck if I want to position images, crop images, layer images on top of each other, etc.
    However, when I press "play", the playback in the canvas viewer works fine. I can watch everything that is in the timeline just fine. But once I stop the player, whichever point I stop at, that image is frozen there, until I press play again. Even when I click a new point on the timeline, the frozen image does not change.
    I just spent half a day clearing out my hard-drive. The Ram disc space says it's okay. And I even ran a disk utility check.
    *** FCP!
    Any suggestions? Anyone ever have this problem?

    Hi - Make sure the Canvas is set to display RGB:
    !http://www.spotsbeforeyoureyes.com/SetCanvastoRGB.jpg!
    Hope this helps.

  • Problem with resizing canvas

    PSE 8, Windows XP
    Attempting to resize the canvas I entire a width and a lenght. I leave the position square in the middle. I click OK. The canvas extension appears only at the bottom of the photo, not all around as it does in PSE 3. I tried relative. Same result, just new canvas at the bottom. I checked Barbara Brundage's book and it should work the same as it does in PSE 3 but doesn't. I also went to PSE "Learn more about canvas size". It also shows that my canvas extensions should show all around. It also suggests that I should be able to choose a background color, but that option is grayed out for me.
    I know I can just do what I want to do using PSE 3 which I kept on my computer for emergencies just like this, but I would like to solve the problem.
    Can anyone tell me what I'm doing wrong?
    Thanks. Eva

    Eva,
    Works fine in my PSE8 on Win XP. I see the following options (sorry, I only have a German version available):
    The image centers just fine. Are you sure you're seing the entire image (ctrl-0)? What's the image format you're working on (PSD, JPG, 8-Bit, 16-Bit)?
    Beat Gossweiler
    Switzerland

  • Problem with rotated canvas in Illustrator

    I'm having a strange problem here. Friend of mine sent me a screen grab of her Illustrator workspace - it seems the artboard got rotated somehow. And she can't get it to straighten back... Neither can I, or any of our friends of designing persuasion... I wasn't even aware you can do that in Illustrator. Anyway, the question is, how do you undo this? All the new files start already rotated, too.
    Screen grab follows:
    http://img27.imageshack.us/img27/1882/ctrln2.jpg
    Any help would be greatly appreciated.

    See Constrain Angle inside the Illustrator Preferences.

  • Problem with AreaChart canvas.addDataChild()

    Hello.
    canvas.addDataChild(hint,_x,_y) works incorrectly. I don't know why).
    I want to when you click it added a hint. There is no reaction after click. I use DateTimeAxis.
    If I set a direct values (canvas.addDataChild (hint, 50,50)), the graph is redrawn and added point scale. Mistification).
    Source:
    <mx:AreaChart ... itemClick="handleChange(event)" >
    <mx:annotationElements>
           <mx:CartesianDataCanvas id="canvas" includeInRanges="true"/>
    </mx:annotationElements>
    </mx:AreaChart>
    <mx:Script>
    <![CDATA[
    private var date:String = new String();
    private var actions:Number = new Number();
    private function handleChange(e:ChartItemEvent):void
         var hint:String = e.hitData.item.hint;
         date = e.hitData.item.date;
         actions = e.hitData.item.actions;
         addLabelsToColumn(hint,date,actions);
    private function addLabelsToColumn(_hint:String,_x:String, _y:Number):void
         canvas.clear();
         hint = new Label();
         hint.setStyle("fontWeight", "bold");
         hint.setStyle("color", "0x660000");
         hint.text = _hint;
         canvas.addDataChild(hint,_x,_y);
    </mx:Script>
    Thanks in advance.

    Upd. I added a few lines for the trace.
    canvas.addDataChild(hint,_x,_y);
    var lab= canvas.getChildAt(canvas.numChildren -1);
    trace(lab.text);
    (in console: 9 actions)
    The hint is added but its coords are equal: 0,0. And hint is not displayed.

  • Problem with my canvas

    I have two classes. I try to write �test� in a Canvas, but nothing happens, why?
    import java.applet.*;
    import java.awt.*;
    public class fot extends Applet {
    myCanvas bild;
    public void init(){
    bild = new myCanvas();
    add(bild);}
    public class myCanvas extends Canvas{
    public void paint(Graphics gb){
    gb.drawString("Test",50,50);}
    }

    You must define a layout:
    setLayout(new BorderLayout());
    bild = new myCanvas();
    add("Center",bild);
    Noah

  • Problem with RGB Values for Canvas Type ‚Horizontal Toolbar' in Webforms 10

    Hello,
    I have a problem with the canvas type ‘Horizontal Toolbar’ in Webforms 10g.
    When I try to set or change the RGB value of a ‘Horizontal Toolbar’ with the forms function
    Set_Canvas_Property(‘my_horizontal_toolbar’, BACKGROUND_COLOR, rgb-value)
    (at runtime) it has no effect in Webforms 10g for the canvas type ‘Horizontal Toolbar’ (the background color of the horizontal toolbar doesn’t change).
    But it works fine for other canvas types like ‘Stacked’ or ‘Content’.
    In Oracle 6i (Client / Server) this function works quiet well (even for the ‘Horizontal Toolbar’ canvas type).
    The reason why we are using rgb values instead of visual attributes in this case is, that the color of the ‘Horizontal Toolbar’ should be customizeable (via a RGB Field) for our customers (at runtime).
    Further more we are using the same technique for Text-Field-Items, Content- and Stacked-Canvases (and all works fine).
    Maybe it has something to do with the pre-configured IAS color-schema (blaf).
    But changing the color schema (e.g.: from 'blaf' to 'red') has no effect also.
    Thanks for your help.

    This is probably bug 777312. Call Support for the latest info on this bug and for help getting it fixed.

  • The problem of the Canvas and JInternalFrame

    I have some problem with the Canvas and JInternalFrame, my application contains serval internalframes and each has one canvas, but i found that canvas is at the top z-order of the window. so it result in that the canvas is at the same z-level, which confuse very much.
    who can help me with this problem, thanks.

    I think the problem stems from mixing AWT and Swing components (non-lightweight and lightweight)
    if the reason you are using a canvas is for the paint method; do away with them and just use a JPanel (which you can use the paint method within)
    hope this helps?!
    Simon

  • I have problems with my films that become slightly jerky after I have imported and edited them in iMovie and then burned them onto a DVD using iDVD. I can see the weak jerkiness when panning in both laterally and vertically. I shoot with a camcorder Canon

    I have problems with my films that become slightly jerky after I have imported
    and edited them in iMovie and then burned them onto a DVD using iDVD.
    I can see the weak jerkiness when panning in both laterally
    and vertically.
    I shoot with a camcorder Canon Vixia HF10. The camera has been set to deliver HD quality (1920x1080). But I have accidentally filmed with a frame rate of 60 (?).
    When I import the films in iMovie I have been asked if I want to change to frame rate 30 (instead of 25). I have chosen 30.
    Could it be the setting of a frame rate 60 in my camcorder that causes jerkiness when panning or what else?

    I have problems with my films that become slightly jerky after I have imported
    and edited them in iMovie and then burned them onto a DVD using iDVD.
    I can see the weak jerkiness when panning in both laterally
    and vertically.
    I shoot with a camcorder Canon Vixia HF10. The camera has been set to deliver HD quality (1920x1080). But I have accidentally filmed with a frame rate of 60 (?).
    When I import the films in iMovie I have been asked if I want to change to frame rate 30 (instead of 25). I have chosen 30.
    Could it be the setting of a frame rate 60 in my camcorder that causes jerkiness when panning or what else?

  • Problems with getWidth() and getHeight() in class Canvas

    Hi,
    i am developing MIDlets with Sun Studio4 One Update1 (Mobile Edition). Here is a simple example Code for my Problem:
    class MyCanvas extends Canvas
        public void paint(Graphics g)
            //Clear the Display
            g.setColor(0,0,0); //black
            g.fillRect(0,0,getWidth(),getHeight());
    }If i try to execute the Program with the Default Color Phone emulator included with Suns WTK2.0, everything works fine. (Ive tried to print out the results of getWidth() and getHeight() on the console, everything ok, the Displays width and height is displayed.).
    The problem is, that any other emulator from WTK1.0.4_01 (included with Sun Studio4 ME) compiles and preverifies fine, but while running the application, the emulator quits with the following error:
    ALERT: No such method getWidth.()I
    Execution completed successfully
    Anyone has an idea?
    Thanks!!

    Hello,
    I'm having the exact same problem and I'd like to know what changes you made to your code to get it working. My class is not an inner class and is very much like yours and so follows the form:
    class MyCanvas extends Canvas{ 
    int element = getWidth()/10;
    public void paint(Graphics g) {        //Clear the Display  
    g.setColor(0,0,0); //black
    g.fillRect(0,0,getWidth(),getHeight());
    I am also using WTK104. I did not have this problem until I renamed my file. I carried the renaming throughout the rest of the file in a consistent fashion and I don't see any problems with it. Any help appreciated.

  • Interlace problem with fast pans, camera moves... any advice?

    Hello: I have a video project, edited in FCP (from SD DVCAM tape source). I exported as a standard 4:3 Quicktime movie, and then encoded as H264 video using the multipass 3ivx codec in Cleaner.
    I now get a blurred horizontal line on camera pans. The blur appears as a broken line on the lower third of the picture.
    Should I not tick the "Adaptive" box?
    I have tried using the de-interlace Eliminate Top Field and the Interlace Auto settings. In both cases I ticked the adaptive box. In both cases I still get a blurred broken line in the lower third area of the video on camera pans.
    I tried a third experiment using DVFilmMaker. I set it up to de-interlace only on movement, and to blur horizontal lines on Motion (thinking this might help to at least give a more natural look to the picture break-up I was already getting).
    Alas, no improvement.
    Yes, if I had a time-machine and extra bucks I would have shot Progressive... but I didn't... so I'm trying to get the best out of what I have.
    Any thoughts... anyone?
    Thanks
    A
    Message was edited by: Adrian Smith4

    Thanks for the info. Just for the record, I have tried all these things too in Compressor, QTPro, Cleaner and DVFilmMaker. I get the same problem with all (a blurred line on fast camera pans)
    My preference for Cleaner (and it's only my opinion) is that it has a more intuitive user interface for correcting gamma, color, image size, bit-rate, without having to search or go to multiple menus. You also see the video as it encodes and visually check any problems with gamma, etc. You can also do a visual before/after check. I guess it's the devil I'm used to.
    Thanks for all the info re. alternatives to Cleaner... but it's not really addressing my original (and existing) problem.
    Thanks
    Message was edited by: Adrian Smith4
    Message was edited by: Adrian Smith4

Maybe you are looking for