Adding keylistener to the entire applet

How can I addKeyListener(this) to the entire applet frame? I know in applications you name the frame and everything then can just add it to whatever you named it, but applets make the frame on their own. So what do I tell to addkeylistener to?

lol thanks
I just put
addKeyListener(this);whatever.. thanks :)

Similar Messages

  • HELP!!! Adding effect turns the entire clip white.

    I've needed to change some of the words on a title clip, but can't edit the clip since it's been saved long ago, so I need to start over with a completely new clip. Well, I get the right font, right size, right title entrance. But then once I try to add the "Aged Film" effect after creating the title, it turns the entire clip white and you can't see anything.
    I'm really frustrated by this since this is one of the last changes I need to make to the video and it won't cooperate for some reason.

    Hi
    a. free space on internal hard disk ?
    b. Did You delete iMovie pref file ?
    c. Did You store Your movie project on an external hard disk ?
    Yours Bengt W

  • Final Cut Pro X crashes when adding transitions, throughout the entire program.

    I've had FCP X installed for a few weeks now, and I decided to hold back asking my question and see if anybody else is experiencing the same problems.
    I did find one matching problem on the discussions forum, but the user found a solution which I tried, and did it did not work.
    Everytime I try to add a very simple transition to my video in Final Cut Pro X, it gives me the spinning colorwheel, hesitates for a few seconds and then crashes.
      It only does it with transitions, I can add effects, adjust color, etc. but only when adding transitions does it crash.
    I've tried deleting events and original media, I've reimported using optimized media, I've tried both ways of keeping files in original locations and also copying to final cut events folder.
    The video I'm using is full 1080p mov files from a Canon 5D Mark II.
    It does it in the timeline as well as the secondary timeline.
    I've tried the solution that the previous asker did, which was copying the content to another FCP event, and it didn't work for me. Still crashes whether I try to drag the transition to my timeline, use the keyboard shortcut, or double click.
    I have a Early 2010 15 inch MBP i5 with 8gb of RAM running newest version of Snow Leopard.
    Hope I've provided enough information
    Thanks,
    -Jon

    Same Issue: Added a transition and then beach ball from **** and crash. Also lost two hours of work when it restarted and reverted to the last planned quit.
    FCPX is benched until Lion and updates. Don't have time to be a beta tester on what might end up being a hobbyists toy.
    MacPro Quad 3.0, 10G RAM.
    Mark

  • Adding a keyListener to an entire Frame

    Hello, any idea's here are warmly appreciated..
    What've got is paint function, that paint 9 boxes on a screen, and then 1 letter in each box. There's no textfield or buttons or anything else, just a for loop calling 9 fillRect and drawString functions.
    Now, what I want to do is attach a KeyListener to the entire Frame containg this paint function, so that whenever the frame/program is in use and highlighted by the user, keyEvents [KeyPressed] triggers actions in my paint function.
    I've tried adding KeyListener to the frame itself and the class containing the paint function (the same way as I would a MouseListener)
    and simply having it doing a system.Out - but there's nothing happening.
    I know there's somethin wrong, but I havnt a notion of what it is.
    Any ideas at all????
    Thanks

    Hello Exception13,
    [..if your still there]
    I've looked up everythin I could about addWindowFocusListener, but I coudnt find anything about how you could use one capture keyEvents.
    In fact, I couldn't find much of a description about them at all. Could you tell me when exactly the window is in focus. ie when the mouse is ocer it, or when it is the active window??

  • Adding music to more than one slide and not the entire presentation

    I love the way Keynote looks and behaves, but it fails to compete with PPT on certain aspects, such as adding the same audio track to more than one slide and NOT have it play for the entire presentation. Using PPT (and I hate PCs!) you can have a track play for "n" number of slides. I'm frustrated that I cannot do this with Keynote! I don't want the track as a soundtrack for the entire presentation. I want to add another audio track to, say, the last two or three slides only and something else for all the other slides. I looked through the user manual, forums, etc. and found that I can only add a soundtrack to the entire thing or a different audio to only one slide.
    Question: What if I cut (that last two slides) and paste the the slides as a new Presentation with its own soundtrack, then reincorporate that back and paste it into the original presentation? Will that work or will the original soundtrack take over the entire presentation again?

    Anyone remember Claris Works for Mac back in the early 90s? Now, that was a gem! What were they thinking when they got rid of that one (and replaced it with AppleWorks!)?
    Good point, but one which Apple has heard a zillion times, and so sadly chosen to ignore. The really heartbroken among us remember AppleWorks from the mid-'80's, the world's first integrated suite, then ClarisWorks, then AppleWorks; and, of course, Beagle Bros. and BeagleWorks. But since we old f*s are dying off, those complaints will eventually stop. +Sic transit gloria mundi.+

  • HT1751 if i back up my itunes library to an external hard drive and then add subsequent music and want to back that up a few days later, can i backup the only newly added music without backing up the entire library again?

    hello,
    if i back up my itunes library to an external hard drive and then add subsequent music and want to back up the newly added music a few days later, can i do it without backing up the entire library again? or do i need to back up the entire library each and every time i back up to the external hard drive?

    Just copy Users/yourusername/Music/iTunes (containing your library-files) to your external drive as well as that (extaernal) folder that contains all your audio-tracks.

  • When is the entire function group added to the transport request

    When you modify a functionmodule in a function group, only the object of the functionmodule( LIMU FUNC) is added to the transport request.
    When you modify an include of the function group, the reportsource of that include (LIMU REPS) is added to the transport request.
    But under some circumstances the entire function group is added to the transport request (R3TR FUGR).
    Can somebody clarify under what circumstances the entire Function Group is added to the transport request?

    I was actually looking for the reason why I would find R3TR FUGR objects in requests for existing function groups.
    What I found out is that R3TR FUGR is added to the request when :
    - the function group is created
    - a function is renamed
    - the function group is deleted
    - you choose : Write Transport Entry, in the context menu of the Function group.
    The <b>actual problem </b> was that in our upgraded system (<b>ERP2005</b>) we had a transport containing the function group (R3TR FUGR) and <b>we thought</b> none of these actions had been taken.  After talking to the developer in question, I found out he did rename a function module, so I have my solution.
    But thanks everybody for the insight.
    Message was edited by: Dries Horions

  • Does adding tcp udp ports on the nat exempt accesslist which is binded to nat 0 statement remove the entire nat 0 statement itself?

    Hi Experts,
    Is the above statement true?. I learnt later that adding tcp and udp ports on the nat 0 statements are supported . But does it take away the entire nat statement? Please answer my question at the earliest.
    Regards
    Krishna

    Krishna,
    "NAT exemption (nat 0 access-list command)—NAT exemption allows both translated and remote hosts to initiate connections. Like identity NAT, you do not limit translation for a host on specific interfaces; you must use NAT exemption for connections through all interfaces. However, NAT exemption does enable you to specify the real and destination addresses when determining the real addresses to translate (similar to policy NAT), so you have greater control using NAT exemption. However unlike policy NAT, NAT exemption does not consider the ports in the access list. NAT exemption also does not support connection settings, such as maximum TCP connections."
    Reference
    So, since the documentation clearly says that this rule does not consider any ports in the ACL, then one should not be testing unsupported configurations.
    If one adds an ACL with specific ports, then unexpected results may be expected.
    My suggestion, dont add any ACL entry with specific ports to your NAT exempt statement.
    Thanks.
    Portu.
    Please rate any helpful posts

  • Udio to my clip.  When I bring it over it highlights the entire clip as opposed to adding it above or below.  Then I can't edit the audio clip.  HELP!!

    Trying to add audio to my clip.  When I bring it over it highlights the entire clip as opposed to adding it above or below.  Then I can't edit the audio clip.  HELP!!

    Just discovered this nifty little bug myself today. Boy, Leopard is really bug city, I'm definitely regretting the upgrade. I was glad to find the 'show in mailbox' trick, although then once I went to re-send the message, it duplicated it for some reason and sent it twice, so now my business contact thinks I'm a moron because I sent him this super large attachment TWICE thanks to moronic Mail.app.
    Another interesting thing though, is that after finding the email via 'show in mailbox' and opening it, it actually displayed the MP3 attachment as the old Tiger quicktime player (w/progress bar) as opposed to when I first composed the message and it would only display it as an icon. I thought they had just removed that feature for some reason, but nope! Another bug!

  • I added a video to my website but it wont play the entire thing? Does anyone have any imput on this?

    I added a video to my website but when I save it and
    aynchronize it doesnt play the entire film. Does anyone have any
    imput on this?
    Thank you.
    D Sterlin

    Actually I just finished doing what you said and my video
    worked!
    Thank you so much for your help!
    It really was very kind of you.
    D Sterlin

  • When adding a PDF file to a New Message in Mail it does not show up as an icon link, the entire document appears. How can you attach a PDF without the entire document displaying itself?

    After scanning a document, I save the file in a PDF format. When attaching the PDF file to a New message it appears on the entire page instead of a PDF icon link that the recipient can click on to open. Why can't I get the PDF file to appear in a icon format? Thank you.

    Control mouse click the document and select View as icon.

  • Adding an effect to a sound, not the entire track

    Hey All, I am looking to simply add a effect to a single sound, not the entire track, is that possible with Logic? I am coming from pro tools, and I know I was able to do that there, I was hoping I could do the same here. Thanks so much!

    By add effect, I assume you mean add some delay or reverb one one particular note or word. Several ways to do this. Put the effect plug-in on a bus return, and then automate the send level to come up/down for that one incident.
    Another way would be to make a 2nd track (audio or midi), Insert the effect on that track, and cut the phrase or note, and move down to that 2nd track. So the whole track would be dry, and that one word, note, would have the effect on the next track.
    Make sure levels are similar

  • Help With adding a scrollbar to my applet

    This is the source code of my applet.I wat to have an autoscroll on this applet
    i think it is usefull if i put here all the code for my project.
    ======================================================
    Class ConsolePanel:
    The file defines a class ConsolePanel. Objects of type
    ConsolePanel can be used for simple input/output exchanges with
    the user. Various routines are provided for reading and writing
    values of various types from the output. (This class gives all
    the I/O behavior of another class, Console, that represents a
    separate window for doing console-style I/O.)
    This class is dependent on another class, ConsoleCanvas.
    Note that when the console has the input focus, it is outlined with
    a bright blue border. If, in addition, the console is waiting for
    user input, then there will be a blinking cursor. If the console
    is not outlined in light blue, the user has to click on it before
    any input will be accepted.
    This is an update an earlier version of the same class,
    rewritten to use realToString() for output of floating point
    numbers..
    package myproj;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.JScrollPane;
    import javax.swing.JScrollBar;
    import javax.swing.*;
    public class ConsolePanel extends JTextArea{
    static public JScrollPane scrollPane;
    // ***************************** Constructors *******************************
    public ConsolePanel() { // default constructor just provides default window title and size
    setBackground(Color.white);
    setLayout(new BorderLayout(0, 0));
    canvas = new ConsoleCanvas(500,1000);
    scrollPane = new JScrollPane(canvas);
    scrollPane.setVerticalScrollBarPolicy(
    JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setPreferredSize( new Dimension( 1000,10000) );
    add("Center", scrollPane);
    //scrollPane.getVerticalScrollBar().setUnitIncrement(1);
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    public void clear() { // clear all characters from the canvas
    canvas.clear();
    // *************************** I/O Methods *********************************
    // Methods for writing the primitive types, plus type String,
    // to the console window, with no extra spaces.
    // Note that the real-number data types, float
    // and double, a rounded version is output that will
    // use at most 10 or 11 characters. If you want to
    // output a real number with full accuracy, use
    // "con.put(String.valueOf(x))", for example.
    public void put(int x) {
    put(x, 0);
    } // Note: also handles byte and short!
    public void put(long x) {
    put(x, 0);
    public void put(double x) {
    put(x, 0);
    } // Also handles float.
    public void put(char x) {
    put(x, 0);
    public void put(boolean x) {
    put(x, 0);
    public void put(String x) {
    put(x, 0);
    // Methods for writing the primitive types, plus type String,
    // to the console window,followed by a carriage return, with
    // no extra spaces.
    public void putln(int x) {
    put(x, 0);
    newLine();
    } // Note: also handles byte and short!
    public void putln(long x) {
    put(x, 0);
    newLine();
    public void putln(double x) {
    put(x, 0);
    newLine();
    } // Also handles float.
    public void putln(char x) {
    put(x, 0);
    newLine();
    public void putln(boolean x) {
    put(x, 0);
    newLine();
    public void putln(String x) {
    put(x, 0);
    newLine();
    // Methods for writing the primitive types, plus type String,
    // to the console window, with a minimum field width of w,
    // and followed by a carriage return.
    // If outut value is less than w characters, it is padded
    // with extra spaces in front of the value.
    public void putln(int x, int w) {
    put(x, w);
    newLine();
    } // Note: also handles byte and short!
    public void putln(long x, int w) {
    put(x, w);
    newLine();
    public void putln(double x, int w) {
    put(x, w);
    newLine();
    } // Also handles float.
    public void putln(char x, int w) {
    put(x, w);
    newLine();
    public void putln(boolean x, int w) {
    put(x, w);
    newLine();
    public void putln(String x, int w) {
    put(x, w);
    newLine();
    // Method for outputting a carriage return
    public void putln() {
    newLine();
    // Methods for writing the primitive types, plus type String,
    // to the console window, with minimum field width w.
    public void put(int x, int w) {
    dumpString(String.valueOf(x), w);
    } // Note: also handles byte and short!
    public void put(long x, int w) {
    dumpString(String.valueOf(x), w);
    public void put(double x, int w) {
    dumpString(realToString(x), w);
    } // Also handles float.
    public void put(char x, int w) {
    dumpString(String.valueOf(x), w);
    public void put(boolean x, int w) {
    dumpString(String.valueOf(x), w);
    public void put(String x, int w) {
    dumpString(x, w);
    // Methods for reading in the primitive types, plus "words" and "lines".
    // The "getln..." methods discard any extra input, up to and including
    // the next carriage return.
    // A "word" read by getlnWord() is any sequence of non-blank characters.
    // A "line" read by getlnString() or getln() is everything up to next CR;
    // the carriage return is not part of the returned value, but it is
    // read and discarded.
    // Note that all input methods except getAnyChar(), peek(), the ones for lines
    // skip past any blanks and carriage returns to find a non-blank value.
    // getln() can return an empty string; getChar() and getlnChar() can
    // return a space or a linefeed ('\n') character.
    // peek() allows you to look at the next character in input, without
    // removing it from the input stream. (Note that using this
    // routine might force the user to enter a line, in order to
    // check what the next character.)
    // Acceptable boolean values are the "words": true, false, t, f, yes,
    // no, y, n, 0, or 1; uppercase letters are OK.
    // None of these can produce an error; if an error is found in input,
    // the user is forced to re-enter.
    // Available input routines are:
    // getByte() getlnByte() getShort() getlnShort()
    // getInt() getlnInt() getLong() getlnLong()
    // getFloat() getlnFloat() getDouble() getlnDouble()
    // getChar() getlnChar() peek() getAnyChar()
    // getWord() getlnWord() getln() getString() getlnString()
    // (getlnString is the same as getln and is onlyprovided for consistency.)
    public byte getlnByte() {
    byte x = getByte();
    emptyBuffer();
    return x;
    public short getlnShort() {
    short x = getShort();
    emptyBuffer();
    return x;
    public int getlnInt() {
    int x = getInt();
    emptyBuffer();
    return x;
    public long getlnLong() {
    long x = getLong();
    emptyBuffer();
    return x;
    public float getlnFloat() {
    float x = getFloat();
    emptyBuffer();
    return x;
    public double getlnDouble() {
    double x = getDouble();
    emptyBuffer();
    return x;
    public char getlnChar() {
    char x = getChar();
    emptyBuffer();
    return x;
    public boolean getlnBoolean() {
    boolean x = getBoolean();
    emptyBuffer();
    return x;
    public String getlnWord() {
    String x = getWord();
    emptyBuffer();
    return x;
    public String getlnString() {
    return getln();
    } // same as getln()
    public String getln() {
    StringBuffer s = new StringBuffer(100);
    char ch = readChar();
    while (ch != '\n') {
    s.append(ch);
    ch = readChar();
    return s.toString();
    public byte getByte() {
    return (byte) readInteger( -128L, 127L);
    public short getShort() {
    return (short) readInteger( -32768L, 32767L);
    public int getInt() {
    return (int) readInteger((long) Integer.MIN_VALUE,
    (long) Integer.MAX_VALUE);
    public long getLong() {
    return readInteger(Long.MIN_VALUE, Long.MAX_VALUE);
    public char getAnyChar() {
    return readChar();
    public char peek() {
    return lookChar();
    public char getChar() { // skip spaces & cr's, then return next char
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    return readChar();
    public float getFloat() { // can return positive or negative infinity
    float x = 0.0F;
    while (true) {
    String str = readRealString();
    if (str.equals("")) {
    errorMessage("Illegal floating point input.",
    "Real number in the range " + Float.MIN_VALUE +
    " to " + Float.MAX_VALUE);
    } else {
    Float f = null;
    try {
    f = Float.valueOf(str);
    } catch (NumberFormatException e) {
    errorMessage("Illegal floating point input.",
    "Real number in the range " + Float.MIN_VALUE +
    " to " + Float.MAX_VALUE);
    continue;
    if (f.isInfinite()) {
    errorMessage("Floating point input outside of legal range.",
    "Real number in the range " + Float.MIN_VALUE +
    " to " + Float.MAX_VALUE);
    continue;
    x = f.floatValue();
    break;
    return x;
    public double getDouble() {
    double x = 0.0;
    while (true) {
    String str = readRealString();
    if (str.equals("")) {
    errorMessage("Illegal floating point input",
    "Real number in the range " + Double.MIN_VALUE +
    " to " + Double.MAX_VALUE);
    } else {
    Double f = null;
    try {
    f = Double.valueOf(str);
    } catch (NumberFormatException e) {
    errorMessage("Illegal floating point input",
    "Real number in the range " + Double.MIN_VALUE +
    " to " + Double.MAX_VALUE);
    continue;
    if (f.isInfinite()) {
    errorMessage("Floating point input outside of legal range.",
    "Real number in the range " + Double.MIN_VALUE +
    " to " + Double.MAX_VALUE);
    continue;
    x = f.doubleValue();
    break;
    return x;
    public String getWord() {
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    StringBuffer str = new StringBuffer(50);
    while (ch != ' ' && ch != '\n') {
    str.append(readChar());
    ch = lookChar();
    return str.toString();
    public boolean getBoolean() {
    boolean ans = false;
    while (true) {
    String s = getWord();
    if (s.equalsIgnoreCase("true") || s.equalsIgnoreCase("t") ||
    s.equalsIgnoreCase("yes") || s.equalsIgnoreCase("y") ||
    s.equals("1")) {
    ans = true;
    break;
    } else if (s.equalsIgnoreCase("false") || s.equalsIgnoreCase("f") ||
    s.equalsIgnoreCase("no") || s.equalsIgnoreCase("n") ||
    s.equals("0")) {
    ans = false;
    break;
    } else {
    errorMessage("Illegal boolean input value.",
    "one of: true, false, t, f, yes, no, y, n, 0, or 1");
    return ans;
    // ***************** Everything beyond this point is private *******************
    // ********************** Utility routines for input/output ********************
    private ConsoleCanvas canvas; // the canvas where I/O is displayed
    private String buffer = null; // one line read from input
    private int pos = 0; // position next char in input line that has
    // not yet been processed
    private String readRealString() { // read chars from input following syntax of real numbers
    StringBuffer s = new StringBuffer(50);
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    if (ch == '-' || ch == '+') {
    s.append(readChar());
    ch = lookChar();
    while (ch == ' ') {
    readChar();
    ch = lookChar();
    } while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    if (ch == '.') {
    s.append(readChar());
    ch = lookChar();
    while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    if (ch == 'E' || ch == 'e') {
    s.append(readChar());
    ch = lookChar();
    if (ch == '-' || ch == '+') {
    s.append(readChar());
    ch = lookChar();
    } while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    return s.toString();
    private long readInteger(long min, long max) { // read long integer, limited to specified range
    long x = 0;
    while (true) {
    StringBuffer s = new StringBuffer(34);
    char ch = lookChar();
    while (ch == ' ' || ch == '\n') {
    readChar();
    if (ch == '\n') {
    dumpString("? ", 0);
    ch = lookChar();
    if (ch == '-' || ch == '+') {
    s.append(readChar());
    ch = lookChar();
    while (ch == ' ') {
    readChar();
    ch = lookChar();
    } while (ch >= '0' && ch <= '9') {
    s.append(readChar());
    ch = lookChar();
    if (s.equals("")) {
    errorMessage("Illegal integer input.",
    "Integer in the range " + min + " to " + max);
    } else {
    String str = s.toString();
    try {
    x = Long.parseLong(str);
    } catch (NumberFormatException e) {
    errorMessage("Illegal integer input.",
    "Integer in the range " + min + " to " + max);
    continue;
    if (x < min || x > max) {
    errorMessage("Integer input outside of legal range.",
    "Integer in the range " + min + " to " + max);
    continue;
    break;
    return x;
    private static String realToString(double x) {
    // Goal is to get a reasonable representation of x in at most
    // 10 characters, or 11 characters if x is negative.
    if (Double.isNaN(x)) {
    return "undefined";
    if (Double.isInfinite(x)) {
    if (x < 0) {
    return "-INF";
    } else {
    return "INF";
    if (Math.abs(x) <= 5000000000.0 && Math.rint(x) == x) {
    return String.valueOf((long) x);
    String s = String.valueOf(x);
    if (s.length() <= 10) {
    return s;
    boolean neg = false;
    if (x < 0) {
    neg = true;
    x = -x;
    s = String.valueOf(x);
    if (x >= 0.00005 && x <= 50000000 &&
    (s.indexOf('E') == -1 && s.indexOf('e') == -1)) { // trim x to 10 chars max
    s = round(s, 10);
    s = trimZeros(s);
    } else if (x > 1) { // construct exponential form with positive exponent
    long power = (long) Math.floor(Math.log(x) / Math.log(10));
    String exp = "E" + power;
    int numlength = 10 - exp.length();
    x = x / Math.pow(10, power);
    s = String.valueOf(x);
    s = round(s, numlength);
    s = trimZeros(s);
    s += exp;
    } else { // constuct exponential form
    long power = (long) Math.ceil( -Math.log(x) / Math.log(10));
    String exp = "E-" + power;
    int numlength = 10 - exp.length();
    x = x * Math.pow(10, power);
    s = String.valueOf(x);
    s = round(s, numlength);
    s = trimZeros(s);
    s += exp;
    if (neg) {
    return "-" + s;
    } else {
    return s;
    private static String trimZeros(String num) { // used by realToString
    if (num.indexOf('.') >= 0 && num.charAt(num.length() - 1) == '0') {
    int i = num.length() - 1;
    while (num.charAt(i) == '0') {
    i--;
    if (num.charAt(i) == '.') {
    num = num.substring(0, i);
    } else {
    num = num.substring(0, i + 1);
    return num;
    private static String round(String num, int length) { // used by realToString
    if (num.indexOf('.') < 0) {
    return num;
    if (num.length() <= length) {
    return num;
    if (num.charAt(length) >= '5' && num.charAt(length) != '.') {
    char[] temp = new char[length + 1];
    int ct = length;
    boolean rounding = true;
    for (int i = length - 1; i >= 0; i--) {
    temp[ct] = num.charAt(i);
    if (rounding && temp[ct] != '.') {
    if (temp[ct] < '9') {
    temp[ct]++;
    rounding = false;
    } else {
    temp[ct] = '0';
    ct--;
    if (rounding) {
    temp[ct] = '1';
    ct--;
    // ct is -1 or 0
    return new String(temp, ct + 1, length - ct);
    } else {
    return num.substring(0, length);
    private void dumpString(String str, int w) { // output string to console
    for (int i = str.length(); i < w; i++) {
    canvas.addChar(' ');
    for (int i = 0; i < str.length(); i++) {
    if ((int) str.charAt(i) >= 0x20 && (int) str.charAt(i) != 0x7F) { // no control chars or delete
    canvas.addChar(str.charAt(i));
    } else if (str.charAt(i) == '\n' || str.charAt(i) == '\r') {
    newLine();
    private void errorMessage(String message, String expecting) {
    // inform user of error and force user to re-enter.
    newLine();
    dumpString(" *** Error in input: " + message + "\n", 0);
    dumpString(" *** Expecting: " + expecting + "\n", 0);
    dumpString(" *** Discarding Input: ", 0);
    if (lookChar() == '\n') {
    dumpString("(end-of-line)\n\n", 0);
    } else {
    while (lookChar() != '\n') {
    canvas.addChar(readChar());
    dumpString("\n\n", 0);
    dumpString("Please re-enter: ", 0);
    readChar(); // discard the end-of-line character
    private char lookChar() { // return next character from input
    if (buffer == null || pos > buffer.length()) {
    fillBuffer();
    if (pos == buffer.length()) {
    return '\n';
    return buffer.charAt(pos);
    private char readChar() { // return and discard next character from input
    char ch = lookChar();
    pos++;
    return ch;
    private void newLine() { // output a CR to console
    canvas.addCR();
    private void fillBuffer() { // Wait for user to type a line and press return,
    // and put the typed line into the buffer.
    buffer = canvas.readLine();
    pos = 0;
    private void emptyBuffer() { // discard the rest of the current line of input
    buffer = null;
    public void clearBuffers() { // I expect this will only be called by
    // CanvasApplet when a program ends. It should
    // not be called in the middle of a running program.
    buffer = null;
    canvas.clearTypeAhead();
    private void jbInit() throws Exception {
    this.setNextFocusableComponent(scrollPane);
    this.setToolTipText("");
    } // end of class Console
    ============================================================
    Class ConsoleCanvas:
    /* A class that implements basic console-oriented input/output, for use with
    Console.java and ConsolePanel.java. This class provides the basic character IO.
    Higher-leve fucntions (reading and writing numbers, booleans, etc) are provided
    in Console.java and ConolePanel.java.
    (This vesion of ConsoleCanvas is an udate of an earilier version, rewritten to
    be compliand with Java 1.1. David Eck; July 17, 1998.)
    (Modified August 16, 1998 to add the
    a mousePressed method to ConsoleCanvas. The mousePressed method requests
    the focus. This is necessary for Sun's Java implementation -- though not,
    apparently for anyone else's. Also added: an isFocusTraversable() method)
    MouseListener interface and
    Minor modifications, February 9, 2000, some glitches in the graphics.
    package myproj;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class ConsoleCanvas extends JTextArea implements FocusListener, KeyListener,
    MouseListener {
    // public interface, constructor and methods
    public ConsoleCanvas(int u,int y) {
    addFocusListener(this);
    addKeyListener(this);
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    public final String readLine() { // wait for user to enter a line of input;
    // Line can only contain characters in the range
    // ' ' to '~'.
    return doReadLine();
    public final void addChar(char ch) { // output PRINTABLE character to console
    putChar(ch);
    public final void addCR() { // add a CR to the console
    putCR();
    public synchronized void clear() { // clear console and return cursor to row 0, column 0.
    if (OSC == null) {
    return;
    currentRow = 0;
    currentCol = 0;
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(4, 4, getSize().width - 8, getSize().height - 8);
    OSCGraphics.setColor(Color.black);
    repaint();
    try {
    Thread.sleep(25);
    } catch (InterruptedException e) {}
    // focus and key event handlers; not meant to be called excpet by system
    public void keyPressed(KeyEvent evt) {
    doKey(evt.getKeyChar());
    public void keyReleased(KeyEvent evt) {}
    public void keyTyped(KeyEvent evt) {}
    public void focusGained(FocusEvent evt) {
    doFocus(true);
    public void focusLost(FocusEvent evt) {
    doFocus(false);
    public boolean isFocusTraversable() {
    // Allows the user to move the focus to the canvas
    // by pressing the tab key.
    return true;
    // Mouse listener methods -- here just to make sure that the canvas
    // gets the focuse when the user clicks on it. These are meant to
    // be called only by the system.
    public void mousePressed(MouseEvent evt) {
    requestFocus();
    public void mouseReleased(MouseEvent evt) {}
    public void mouseClicked(MouseEvent evt) {}
    public void mouseEntered(MouseEvent evt) {}
    public void mouseExited(MouseEvent evt) {}
    // implementation section: protected variables and methods.
    protected StringBuffer typeAhead = new StringBuffer();
    // Characters typed by user but not yet processed;
    // User can "type ahead" the charcters typed until
    // they are needed to satisfy a readLine.
    protected final int maxLineLength = 256;
    // No lines longer than this are returned by readLine();
    // The system effectively inserts a CR after 256 chars
    // of input without a carriage return.
    protected int rows, columns; // rows and columns of chars in the console
    protected int currentRow, currentCol; // current curson position
    protected Font font; // Font used in console (Courier); All font
    // data is set up in the doSetup() method.
    protected int lineHeight; // height of one line of text in the console
    protected int baseOffset; // distance from top of a line to its baseline
    protected int charWidth; // width of a character (constant, since a monospaced font is used)
    protected int leading; // space between lines
    protected int topOffset; // distance from top of console to top of text
    protected int leftOffset; // distance from left of console to first char on line
    protected Image OSC; // off-screen backup for console display (except cursor)
    protected Graphics OSCGraphics; // graphics context for OSC
    protected boolean hasFocus = false; // true if this canvas has the input focus
    protected boolean cursorIsVisible = false; // true if cursor is currently visible
    private int pos = 0; // exists only for sharing by next two methods
    public synchronized void clearTypeAhead() {
    // clears any unprocessed user typing. This is meant only to
    // be called by ConsolePanel, when a program being run by
    // console Applet ends. But just to play it safe, pos is
    // set to -1 as a signal to doReadLine that it should return.
    typeAhead.setLength(0);
    pos = -1;
    notify();
    protected synchronized String doReadLine() { // reads a line of input, up to next CR
    if (OSC == null) { // If this routine is called before the console has
    // completely opened, we shouldn't procede; give the
    // window a chance to open, so that paint() can call doSetup().
    try {
    wait(5000);
    } catch (InterruptedException e) {} // notify() should be set by doSetup()
    if (OSC == null) { // If nothing has happened for 5 seconds, we are probably in
    // trouble, but when the heck, try calling doSetup and proceding anyway.
    doSetup();
    if (!hasFocus) { // Make sure canvas has input focus
    requestFocus();
    StringBuffer lineBuffer = new StringBuffer(); // buffer for constructing line from user
    pos = 0;
    while (true) { // Read and process chars from the typeAhead buffer until a CR is found.
    while (pos >= typeAhead.length()) { // If the typeAhead buffer is empty, wait for user to type something
    cursorBlink();
    try {
    wait(500);
    } catch (InterruptedException e) {}
    if (pos == -1) { // means clearTypeAhead was called;
    return ""; // this is an abnormal return that should not happen
    if (cursorIsVisible) {
    cursorBlink();
    if (typeAhead.charAt(pos) == '\r' || typeAhead.charAt(pos) == '\n') {
    putCR();
    pos++;
    break;
    if (typeAhead.charAt(pos) == 8 || typeAhead.charAt(pos) == 127) {
    if (lineBuffer.length() > 0) {
    lineBuffer.setLength(lineBuffer.length() - 1);
    eraseChar();
    pos++;
    } else if (typeAhead.charAt(pos) >= ' ' &&
    typeAhead.charAt(pos) < 127) {
    putChar(typeAhead.charAt(pos));
    lineBuffer.append(typeAhead.charAt(pos));
    pos++;
    } else {
    pos++;
    if (lineBuffer.length() == maxLineLength) {
    putCR();
    pos = typeAhead.length();
    break;
    if (pos >= typeAhead.leng

    Hi
    I don't understand the exact need you want
    you want to add Scrolling facility to your Entire Applet or only for the Textarea Class?
    In first case
    Create the ScrollPane and add it to the applet contentPane. and put entire components to a Panel and just add it to scroll pane.
    Regards
    Vinoth

  • Adding loops to the loop browser.

    I'm using mac os 10.4.11. I have placed all my loops on an external hard drive.
    1) Are only apple loops allowed to be added or aiff loops in general as well?
    2) when adding loops to the loop browser should one add an entire folder if they are in a folder or just the files within a folder? I added a folder of flutes but can not find flutes anywhere in the loop browser file list.
    3) As I didn't want the loops within the jam pack voices, and rhythm section installer packages to be added to garageband I removed the loops folders from the packages, and dropped them onto the loop browser. When looking in the jam pack management it shows the rhythm section but not the voices. When I again attempted to drop the voices folder it said it was already there, although I still can't see it.
    4) Once I understand how to do this correctly should I trash the loop browser apple loops index file and re-drop all the loops on the browser again to get everything cataloged correctly?
    Thank you,
    Robert

    Select "Add to Loop Library" from the Edit menu!

  • How do I move just my movies folder (not the entire iTunes library) to an external hard drive and still be able to watch movies?

    My movies library is getting frighteningly large, and I want to move it (not the entire library) to an external HD, and still be able to watch the movies (when the HD is connectec). How would I do that?

    It's not a feature of iTunes but can be done using various work-arounds.
    Small hard drive? Split your iTunes library across multiple volumes - http://www.macyourself.com/2009/04/24/small-hard-drive-split-your-itunes-library -across-multiple-volumes/  - copying media folders to external, then deleting from internal, then adding again.
    Splitting & Managing Your iTunes Library - http://machintsandtips.com/i-j-k/itunes/splitting-managing-your-itunes-library/ - using option+drag to override iTunes from copying file to your default media folder.
    https://discussions.apple.com/message/10160819#10160819 - Change location of media folder to start putting files on second drive.  Note later follow-up post about leaving 'organize media' and 'copy to drive' checked.
    TuneSpan: (OS X app) A utility that allows you to distribute the media files in your iTunes Library across multiple drives. - http://tunespan.com/ - https://itunes.apple.com/us/app/tunespan/id528459889?mt=12 - Requirements: OS X 10.6.6 or later, 64-bit processor

Maybe you are looking for

  • Safari keep on says closed unexpectedly and dont open.

    Process:         Safari [1123] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         7.0 (9537.71) Build Info:      WebBrowser-7537071000000000~3 Code Type:       X86-64 (Native) Parent Pro

  • Count of characters in a string

    Hi all, Is there any way to find the repeating characters in the string like 'L' in the example Hello .. Thanks in advance, Nalla ! Message was edited by: Nalla Nalla (Nallasivam)

  • OID 2 WAY LDAP replication

    Has anyone been able to create a multi master replication environment between 3 OID servers using LDAP 2 way replication between each? Scenario oid1 --> oid2 oid1 --> oid3 oid2 --> oid1 oid2 --> oid3 oid3 --> oid1 oid3 --> oid2 I can get oid1 to repl

  • Best setup for cache location?

    Hi all, I'm wondering if moving my cache will speed up my editing workflow and timeline playback at all. Here's what I have going on right now: I'm editing with FCPX 10.1 on a late 2013 iMac, i7 processor, 16GB RAM, 256GB SSD, 4GB Nvidia GPU. My foot

  • Cannot install GLIB on OSX 10.6 (configure: error: *** No iconv() implement

    Folks, I've been trying everything I can to install GLIB 2.23.0 on OSX 10.6 and it's failing when I attempt to run the ./configure with this error message below. checking for libiconv_open in -liconv... no configure: error: * No iconv() implementatio