Canvas and Text

I have a slight problem, that I would greatly appreciate help with. I'm trying to create a program that has a window for text output, but does not use swing. A normal AWT TextArea doesn't work, because it can only hold a limited amount of text, and if you delete text off the top to stop overflow, the whole window jumps up to the top, then back to the bottom again.
What I would like to do, is I would like to have a canvas that would act like a text area, except it would only display a certain amount of lines, and delete the lines that run off the top so that they don't take up memory and basically have the same problem as a TextArea. Thanks.

If ypou need it just for output you could use a set labels TextFields or other 1 line Components and always move the texts one step up if new text arrives

Similar Messages

  • FCP 7, viewer clear, but canvas and export blurry

    Started with screen recordings provided to me that made using quicktime 10
    took quicktime 10 screen recordings and converted them to prores422 HQ in compressor (settings from compressor below)
    imported into FCP 7.
    They look great in viewer, reasonably sharp and crisp, but them very blurry in canvas and when I export to quicktime movie (not using quicktime conversion). Been using FCP 7 a couple years but my knowledge in many aspects is sub professional.
    Tried creating a new sequence to get the sequence to match the settings of the quicktime prores422 screen capture movies but to no avail. The settings of the sequence are not the same as the screen capture movies...I even tried to change the sequence settings but no luck (then exited FCP without saving so as not to screw anything up).
    Im probably breaking basic rules here...any help is greatly appreciated.
    Thank you!!!
    Compressor settings for file conversion above:
    Name: Apple ProRes 422 for Interlaced material (High Quality)
    Description: Apple ProRes 422 10-bit video with audio pass-through. Settings based off the source resolution and frame-rate.
    File Extension: mov
    Estimated size: 412.09 MB
    Audio: multi-track passthrough
    Video Encoder
    Format: QT
    Width: (100% of source)
    Height: (100% of source)
    Selected: 1440 x 900
    Pixel aspect ratio: Square
    Crop: None
    Padding: None
    Frame rate: (100% of source)
    Selected: 15.002
    Frame Controls: Automatically selected: Off
    Codec Type: Apple ProRes 422 (HQ)
    Multi-pass: Off, frame reorder: Off
    Automatic gamma correction
    Progressive
    Pixel depth: 24
    Spatial quality: 50
    Min. Spatial quality: 0
    Temporal quality: 0
    Min. temporal quality: 0

    Here is additional information on the problem.
    My sequence includes mostly screen captures, but also some other video (settings below) and some JPEGs.  The other video and the JPEGs look fine...both in canvas and when I export sequence to quicktime.  The screen captures look terrible...text is very blurry.  Same screen captures look fine in my viewer, just goes awry when in canvas and export.
    Format of screen capture clips (quicktime 10 screen capture > compressor prores 422 HQ):
    1440x900, apprle prores 422 HQ, data rate 5.6 MB/S, pixel aspect square, field dominance none, composite normal.  Started with 4 files of the screen capture from compressor, then edited them into many little pieces in FCP...the size of those files post compressor are around 2GB each.
    The sequence (by default) had settings of:
    frame size: 720x480 NTSC DV 3:2
    pixel aspect ratio: NTSC - CCIR 601 / DV 720x480
    field dominance lower(even)
    quicktime compressor settings: apple prores 422 LT
    Vast majority of clips are the same as screen capture clips.  But just in case its part of the problem, I have also have a couple video clips of that have settings:
    frame size:  720x480
    compressor:  DV/DVCPRO - NTSC
    data rate 3.6mb/s
    pixel aspect: NTSC - CCIR 601
    field dominance: Lower/even
    also have a couple JPEGs, their settings are:
    frame size 2500x2084
    compressor: photo-jpeg
    field dominance: none
    Thank you!!!  I've been using final cut a while, but don't think I would have gotten anywhere without the help and generosity of people that are way beyond my knowledge and skills.  I am happy to provide any more info.  I really appreciate it.

  • DrawString and text formatting

    Hi guys,
    My problem is the following: I have an editor where the user can add simple shapes. Now I want to allow the user to add some text under the drawings, to explain what they represent. I'm using a key listener to capture the text and then g.drawString() to make the text appear on the canvas. The problem is that I would like to allow the user to do some fancier stuff with the text, have a cursor, go back to insert text in the middle of the existing text, select text etc. I also want to keep the appearance as he/she is typing directly onto the canvas and not in some separate widget (hence I can't use a JTextPane etc).
    I have some idea about how to do all this, but drawing the cursor myself and continously refreshing the whole canvas after each action looks live a very expensive computational choice.
    Is there any way in which I can make use of the existing text methods to solve my problem?
    Any help will be appreciated.
    Andra

    write a JComponent which extends JTextArea(or textpane) and remove border. or override paintBorder(Graphics g) method and leave it blank. you cant see the border so, it doesnt appear on the canvas. easiest way. i my self am writing one of such application, and i used this way to do that it looks pretty good.

  • Canvas and BufferedImage display different.

    I use the same method to paint the Canvas and the BufferedImage. But the Graphics2D drawString method
    shows up correctly on the Canvas but not on the BufferedImage (JPEG). Why is there a difference?
    I use the Graphics2D to rotate the text 90 degrees.
    I can't think of any reason why the display comes out different.
    Any suggestions???
    Thanks.

    Here is the code for putting the Canvas graphics onto the BufferedImage (JPEG).
    public void save(HCanvas comp) {
         int w = comp.getWidth();
         int h = comp.getHeight();
         Frame frame = new Frame();
         BufferedImage im = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
         Graphics2D g2 = im.createGraphics();
         g2.setPaint(Color.white);
         g2.fillRect(0,0,w,h);
         g2.setPaint(Color.black);          // back to default color
         comp.paint(g2);                              // Graphics argument
         g2.dispose();
         FileDialog fd = new FileDialog(frame,"Save As JPEG",FileDialog.SAVE);
         fd.show();
         try {
              String dum;
              dum = fd.getDirectory() + fd.getFile();
              OutputStream out = new FileOutputStream(dum);
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
              encoder.encode(im);
              out.flush();
              out.close();
              im.flush();
         } catch (Exception FileNotFoundException) {
              String errormsg = "File Not Assigned";
              JOptionPane.showMessageDialog(frame, errormsg);

  • Canvas and BufferedImage display drawString differently.

    I use the same method to paint the Canvas and the BufferedImage. But the Graphics2D drawString method
    shows up correctly on the Canvas but not on the BufferedImage (JPEG). Why is there a difference?
    I use the Graphics2D to rotate the text 90 degrees.
    I can't think of any reason why the display comes out different.
    Any suggestions???
    Thanks.

    Here is the code for putting the Canvas graphics onto the BufferedImage (JPEG).
    public void save(HCanvas comp) {
    int w = comp.getWidth();
    int h = comp.getHeight();
    Frame frame = new Frame();
    BufferedImage im = new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = im.createGraphics();
    g2.setPaint(Color.white);
    g2.fillRect(0,0,w,h);
    g2.setPaint(Color.black); // back to default color
    comp.paint(g2); // Graphics argument
    g2.dispose();
    FileDialog fd = new FileDialog(frame,"Save As JPEG",FileDialog.SAVE);
    fd.show();
    try {
    String dum;
    dum = fd.getDirectory() + fd.getFile();
    OutputStream out = new FileOutputStream(dum);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(im);
    out.flush();
    out.close();
    im.flush();
    } catch (Exception FileNotFoundException) {
    String errormsg = "File Not Assigned";
    JOptionPane.showMessageDialog(frame, errormsg);

  • Looping/iterating the structure (DOM?) of a Canvas and children

    I did some forum and web searches and couldn't find a clear answer  (or perhaps they were clear and I didn't understand them).
    I have a Canvas in which users trigger Actionscripts to create and position new Panels.
    The Panels have Text objects in which they can type information.
    I need to iterate through the Canvas, discover all of the Panels, and get each Panel's ID, X/Y coordinates, and Text-object content.
    Can anyone point to an example or tutorial that shows this?  Or maybe provide an example?
    I think the XML and XMLList classes are the way to go, but I'm not positive.
    Thanks for any help.

    I think this code, making use of the getChildren() method and the "is" operator, should prove useful.
    If this post answered your question or helped, please mark it as such.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.controls.Label;
          import mx.containers.Panel;
          [Bindable] private var newX:uint = 0;
          [Bindable] private var newY:uint = 0;
          [Bindable] private var objCount:uint = 0;
          private function addPanel():void{
            var p:Panel = new Panel();
            var l:Label = new Label();
            l.text = "New Label";
            p.addChild(l);
            p.x = newX;
            p.y = newY;
            p.id = String(objCount++);
            p.title = "My ID: " + String(p.id);
            newX += 100;
            myCanvas.addChild(p);
            txt.text = "";
            for each(var obj:Object in myCanvas.getChildren()){
              if(obj is Panel){
                txt.text += "Panel ID: " + obj.id + "                  ";
        ]]>
      </mx:Script>
      <mx:Canvas id="myCanvas"/>
      <mx:Button label="Add Panel" click="addPanel();"/>
      <mx:TextArea id="txt" width="100%" height="100%"/>
    </mx:Application>

  • Canvas and form (&elements)

    Hi, i wanna use input box with canvas. As i googled it is not possible. It says i have to write my own inputbox.
    First question: is there another way use inputbox with canvas?
    Second: Can i use canvas and form together. Can i draw something with canvas on half of screen, can i put a form on another part?

    aDiGe wrote:
    Lets make clear my problem.
    I have letters in square and i am changing square's background in my code. It is easy to make with canvas. But i need an InputBox under the letters, it is a bit hard for me to draw it with canvas.You mean you have problems making it editable, right? Because I can't imagine having problems with drawing some background under the letters. Or perhaps you should define what exactly do you mean by "InputBox".
    I thought to use form. When i use StringItem for letters i can not change their backgrounds (i dont know if it is possible)
    &#304; tried to use ImageItem for letters. I made each of letters image. When i ll change their background i am putting another letter image on the other letter image which has different background. But i am not sure if it ll be problem about performance.
    Any idea??Do I understand it correctly that you tried to simulate a TextField (which is an already available Item) using ImageItems only to have some background color under the text?
    I don't know what application are you writing, but what's wrong with a simple TextField? If you're using Canvas for the rest of your application and sometimes you need some text input, just switch to a Form, let the user enter the data and switch back.
    If you don't like the look of the high level GUI, implement your own TextField usable with Canvas. But trying to bend a Form like you described is just... odd.

  • Flicker Problems with a dynamic Canvas and scrollpane

    Hello all,
    I'm having some trouble with flickering in a dynamically sizing canvas. Basically I have a new component similar to a text area implemented as a canvas. I put this canvas into a scrollpane and it is updated when a new message comes in. problem occurs both when a new msg comes in and when the scrollbar is used. I get heavy flickering in the component area and no where else. I've tried double buffering, I've looked through some of the old topic threads here and tried a few suggestions but it still occurs. I traced the paint/update calls with printlns into the console and found that only the paint gets called and not the update. I'm thinking that the changing height of the canvas is automatically calling the paint method directly. Any and all help (that works) will be rewarded with duke dollars. I really need help on this one. Below is a cut away of the code:
    CANVAS COMPONENT
    public class IconBox extends Canvas {
    //other methods to handle text processing
    public void append(String text)
    //places text into a vector and calls repaint to add it to
    //the canvas and updates the height of the canvas
    public void update (Graphics g)
    paint(g);
    public void paint(Graphics g)
    // I basically refresh the canvas with new text updates
    // here with g,drawtexts and add a few images with
    // drawimage
    APPLET
    public class ConfDraw extends Applet implements ComponentListener
    newTextarea lC;
    ScrollPane appletScroller
    public void init()
    lC = new IconBox(427);
    lC.addComponentListener(this);
    appletScroller = new ScrollPane(1);
    appletScroller.add(lC,0);
    appletScroller.setSize( 445, 380 );
    public void componentResized(ComponentEvent e) {
    appletScroller.doLayout();
    public void componentHidden(ComponentEvent e) {
    public void componentMoved(ComponentEvent e) {
    public void componentShown(ComponentEvent e) {
    // other methods that send text to IC
    public void update(Graphics g)
    //tried with and without this over ride at this level
    paint(g);
    }

    Create offscreen image & graphics
    eg.
    Image offscreenImg = createImage(w, this.size().height);
    Graphics offscreenG = offscreenImg.getGraphics();paint all ur contents on off screen grpahics.
    eg.
    offscreenG.drawString("Hello", 10, 10);finally paint the off-screen image to the Graphics
    g.drawImage(offscreenImg,0,0,this);This will avoid flickering as whole of the image is replaced at once. Also override update.

  • HT204053 Our family uses one Apple ID for all of our iPhones.  We installed the update and now we are all getting each others photos and texts.  How do we stop this?

    Our family uses one Apple ID for all of our iPhone 5's.  We installed the update and now we are all receiving each other's pictures and texts.  How do we stop this? 

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    My phone has been smashed I need to get records of all my iMessages and texts from the last month. How do I get these?

    Do you have a backup of your iPhone which contains these messages?
    If so, you can restore a new iPhone from that backup during setup.
    If not, the messages are gone.

  • What is difference between I-mesage and Text Message, some I want to send I message and but I send text and it's charge to me

    What is difference between I-mesage and Text Message, some timeI want to send I-message and but I send text and it's charge to me.

    Thanks Wj,
    another question, how I got to know, my I-message is activated, I put as ON, but I am not getting mesage it's activated, there is link showing to me, learn more abount I-message. do it will take time? please advise how I can activate my I-message. Please advise.

  • Pictures and text boxes in rtf template

    Hi there,
    are there any general rules for applying pictures and text boxes to rtf-templates?
    As far as I have experienced, the text boxes are not shown when generating a report. Is it generally not possible to display text boxes? Are there any work arounds?
    Thank you,
    BR
    Lena

    Hi,
    do you mean instead of text boxes?
    Yes, that is no pborlem.
    Are there any known issues regardings pictures and any other design elements?
    Thank you!
    BR
    Lena

  • Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?

    Why does my 3G iPhone no longer rings nor vibrates when receiving calls and text messages?
    During a two weeks process, little by little I notice my phoe doesn't ring when I get a phone call.  So Far I have missed 22 calls that I am aware of.  Moreover, the phone does not alert me when I get a text message.  Sometimes I receive notice the next day that I received a call or a text message. 

    Follow the basic troubleshooting steps outlined in the user guide... reset, restore from backup, restore as new.

  • IPhone 4 iOS 5.0.1 stops receiving calls and text messages

    Hi all,
    My iPhone 4 (iOS 5.0.1) suddenly stopped receiving calls and text messages. However, I'm still able to send them.
    The workaround for fixing this issue is to make an hard reset to the iPhone.
    This only occured with 5.0.1 version. It's very annoying because I'm not able to know if it's working or not (I can only suppose that it's not working when I'm a long period without receiving calls/messages)
    Do you know how to solve this ?
    Thanks in advance!

    JasminGomez wrote:
    I already hate iphones and I'm reconsidering my blackberry again because at least that one didn't fail me like this one does!
    First, who really cares what you do?  I certainly don't, and I doubt the vast majority of users on this forum don't either.  Ridiculous statements like that just make you look stupid.
    Second, this is a user to user technical support forum.  I saw a lot of whine here, not a question.  What is your technical support question?

  • How do I shut off receiving phone and text messages when I a out of the country but instill want to send and receive emails emails

    How do I shut off receiving phone and text messages when I am out of the country.  I still want to be able to email and receive email on wifi

    Enable Airplane mode followed by turning on wi-fi access.

Maybe you are looking for