Adding a ScrollBar to a node

Hi,
I have a simple setup where I am creating a few rectangles and just want to be able to scroll through them.
Cant seem to get this working, any help will be most appreciated!
Heres my code:
* Main.fx
* Created on Jul 11, 2009, 8:14:56 PM
package proj;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.ScrollBar;
import javafx.scene.Group;
import javafx.scene.CustomNode;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
var Schedule:HourlySchedule[];
package class HourlySchedule extends CustomNode {
public var yPos: Number;
     public override function create(): Node {
         return Group {
             translateY: yPos - 5
             content: [
                 Rectangle {
                     //x: 10, y: 10
                     width: 425, height: 28
                     fill: Color.WHITE
                     stroke: Color.BLACK
public function run()
    for (i in [0..23]){
        insert HourlySchedule{yPos: i * 32}into Schedule
    var scroll = ScrollBar {
        translateX: 450
        translateY: 25
        height: 350
        scaleX: 0.5
        blockIncrement: 16
        clickToPosition: false
        min: 0
        max:12
        vertical: true
    var rect_height: Integer = 35;
    var ScheduleList: Group = Group {
       translateY: bind 0 - scroll.value * rect_height
         content: [ Schedule ]
Stage {
    title: "Scrolling"
    x: 100
    y:100
    width: 1050
    height: 468
    scene: Scene {
        content:[ScheduleList,scroll]
}

wow, that's weird.
This is the error I get on executing that code:
standard-run:
# An unexpected error has been detected by Java Runtime Environment:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d8d0f4c, pid=7660, tid=4928
# Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode, sharing windows-x86)
# Problematic frame:
# V [jvm.dll+0xd0f4c]

Similar Messages

  • Adding a scrollbar to a portlet

    I am trying to limit the amount of screen space that my portlets take up, so I want to add a scrollbar to them if this is possible. I read earlier about possibly using a javascript. If anyone has experience with adding a scrollbar, I'd appreciate the assistance. Thanks.

    Hi,
    If the matter to be displayed is static then try floating frames.
    Regards,
    Mandar
    null

  • Calendar Server 4: Adding a user to a node does not add ou attribute

    In Netscape Calendar Server (CS) 3.5, if I add a new user with an organizational
    unit (ou)
    attribute to a Calendar Server node, the server will create an
    ou so that the Calendar client
    will be able to use the ou
    parameter to search for this user.
    <P>
    However, in CS 4.0, if I add a new user to an ou
    and then add that user to a Calendar
    node, the server does not automatically create a separate ou
    attribute.
    <P>
    Will I need to manually add the separate ou
    attribute to the ldif
    <P>
    No. The CS 4.0 server, unlike the CS 3.5 server, supports mapping from
    Calendar Server attributes to LDAP attributes. You can find more information
    on this mapping property in the Administrator's Guide for Netscape Calendar
    Server 4.0 at the following URL:<BR>
    <P>
    http://docs.iplanet.com/docs/manuals/calendar/ncs40/ag/appendie.htm#1025959.
    <BR>
    <P>
    To enable this mapping, in the [LDAP]
    section of the
    /users/unison/misc/unison.ini file,
    add the following entry:<BR>
    <P>
    attr_orgunit1 = "ou"

    Is there a way to enter multiple groups? Guess I'll have to learn how to do multi input in a real custom form.The "MultiSelect" HTML Component works for me and I cant think of any other suitable component. Multiselectable List maybe. Fill the allowedValues property with a hardcoded list (*BAD*) or directly from a search on LDAP (_GOOD_) using IDM getResourceObjects FormUtil. You should find plenty of examples how to use it in the forum.
    One issue I noticed, I've verified the user was added to the group using an external ldap tool (JXplorer), however now that group has disappeared from the LDAP resource browser list view.(I personally prefer the good old [lbe LDAP Browser\Editor|http://www-unix.mcs.anl.gov/~gawor/ldap/] or ldapadmin)
    That shouldn't happen... Verify the group is still there, the objectclass isnt changed by IDM (really shouldnt happen...) and make double sure nobody else screwed around with it. Groups of objectclass groupOfNames and groupOfUniqueNames (and posixGroup but that's a different schema mapping) are supported by default afaik.

  • ASM disk added without scan on second node

    Hi All ,
    Oracle Version:11.2.0.3
    I need one help for one issue with ASM disk addition.
    It is a two node RAC and one disk group was filled.
    One disk was available as UNUSED001 and so we renamed it ran scan disk  and added the disk to the diskgroup on node1.
    But , as we did not run the scan disk on second node , the name is still showing as UNUSED001 and assigned to diskgroup so showing as MEMBER.
    Also, the renamed disk is also showing as MEMBER but not assigned with any diskgroup.
    Usually, when this heppens we have to reboot the node to fix the issue , but would like to get idea if this can be fixed without bouncing nodes.

    Hi ,
    + Probably that disk addition failed with ORA-15075 as same named device is not visible after renaming of disk.
      As this validation takes place after writing disk header ,it is showing as MEMBER.
    + Get downtime of cluster on 2nd node and run scandisks on 2nd node.
    + Now renamed disk should be showing up on node 2.
    + if showing up ,then validate .
    -- All expected diskgroups were mounted on both nodes or not
    sql> select inst_id,name,state from gv$asm_diskgroup;
    -- If mounted validate that renamed disk group_number and mount_status
    sql> col path for a30
    sql> select inst_id,group_number,path,mount_status from gv$asm_disk;
    + If group_number is 0 and mount_status is CLOSED ,then it is not part of any mounted diskgroup.
      Add that disk again with force option in same diskgroup.
    sql> alter diskgroup <diskgroup_name> add disk 'ORCL:<LABEL_NAME>' force;
    And allow rebalance to complete.
    Regards,
    Aritra

  • Adding a scrollbar to a panel

    this seems like it should be a no brainer.  I am dynamically adding elements to a panel, and sometimes there is too much stuff and the size of the window gets enormous.  I would like a fixed windoe size, and if the elements in the panel spill over the edge, give me a scrollbar to see those items that arent visible.
    this is not the first time I have set out to solve this problem...is there really no way to have a scrolling panel?  the javascript tools guide speaks of a scrollbar element, but it is not documented very well and does not appear to do much of anything.
    Mike Cardeiro

    Continued here:
    http://forum.java.sun.com/thread.jspa?threadID=5146140
    OP, don't you think one thread's enough?

  • Weird results when adding or validating nt:file-Node

    Hello,
    I'm trying to add the absolute path: /content/2012/201212/20121219_lh_lu_1442.pdf/jcr.content/renditions/original/jcr.content by this code:
    Node parentNode = session.getNode("/content");
                  Verbose.message(3,"Add node " + folders[folders.length-1]);
            if (session.nodeExists(parentNode.getPath()+"/"+"2012"))  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"2012");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("2012", "sling:OrderedFolder");
               Verbose.message(3,parentNode.getPath() + " created");
            if (session.nodeExists(parentNode.getPath()+"/"+"201212"))  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"201212");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("201212", "sling:OrderedFolder");
               Verbose.message(3,parentNode.getPath() + " created");
            // dam:Asset-Node named with the PDF-Name
            Verbose.message(3,"Add node 20121219_lh_lu_1442.pdf ");
            if (session.nodeExists(parentNode.getPath()+"/"+"20121219_lh_lu_1442.pdf")  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"20121219_lh_lu_1442.pdf");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("20121219_lh_lu_1442.pdf", "dam:Asset");
                Verbose.message(3,parentNode.getPath() + " created");
            // jcr:content
            if (session.nodeExists(parentNode.getPath()+"/"+"jcr.content"))  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"jcr.content");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("jcr.content", "dam:AssetContent");
                session.save();
                Verbose.message(3,parentNode.getPath() + " created");
            // metadata
            Node metadata=null;       
            if (session.nodeExists(parentNode.getPath()+"/"+"metadata"))  {
                metadata = session.getNode(parentNode.getPath()+"/"+"metadata");
                Verbose.message(3,metadata.getPath() + " already there");
            else  {
                metadata=parentNode.addNode("metadata", "nt:unstructured");
                session.save();
                Verbose.message(3,metadata.getPath() + " created");
            // renditions
            if (session.nodeExists(parentNode.getPath()+"/"+"renditions"))  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"renditions");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("renditions", "nt:folder");
                Verbose.message(3,parentNode.getPath() + " created");
            listChildren("--->", parentNode );
            // orignal
            Verbose.message(3,"Create node " + parentNode.getPath()+"/"+"orignal - Exists=" + session.itemExists(parentNode.getPath()+"/"+"orignal"));
            if (session.nodeExists(parentNode.getPath()+"/"+"orignal"))  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"orignal");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("orignal", "nt:file");
                parentNode.addNode("orignal", "nt:file");
                Verbose.message(3,parentNode.getPath() + " created");
            // jcr:content
            Verbose.message(3,"Add node 'jcr.content' to " + parentNode.getPath());
            if (session.nodeExists(parentNode.getPath()+"/"+"jcr.content"))  {
                parentNode = session.getNode(parentNode.getPath()+"/"+"jcr.content");
                Verbose.message(3,parentNode.getPath() + " already there");
            else  {
                parentNode = parentNode.addNode("jcr.content", "nt:resource");           
    //            session.save();
                Verbose.message(3,parentNode.getPath() + " created");
            session.save();
            return parentNode.getPath();
        private static void listChildren(String indent, Node node ) throws RepositoryException {
            System.out.println("-->" + indent + node.getName()+ " Exists=" + session.nodeExists(node.getPath()));
            NodeIterator ni = node.getNodes();
            while(ni.hasNext()) {
                Node nextNode=ni.nextNode();
                listChildren(indent+"  ", nextNode);
                String NAME = nextNode.getName();
    (Just to avoid irritations; the Verbose class does the logging.)
    My program fails in the line "parentNode = parentNode.addNode("orignal", "nt:file");" with the messages:
    Okt 29 16:33:14 --- Verbose(3): /content/2012 already there
    Okt 29 16:33:14 --- Verbose(3): /content/2012/201212 already there
    Okt 29 16:33:14 --- Verbose(3): Add node 20121219_lh_lu_1442.pdf
    Okt 29 16:33:14 --- Verbose(3): /content/2012/201212/20121219_lh_lu_1442.pdf already there
    Okt 29 16:33:14 --- Verbose(3): /content/2012/201212/20121219_lh_lu_1442.pdf/jcr.content already there
    Okt 29 16:33:14 --- Verbose(3): /content/2012/201212/20121219_lh_lu_1442.pdf/jcr.content/metadata already there
    Okt 29 16:33:14 --- Verbose(3): /content/2012/201212/20121219_lh_lu_1442.pdf/jcr.content/renditions already there
    -->--->renditions Exists=true
    -->--->  original Exists=true
    -->--->    jcr:content Exists=true
    Okt 29 16:33:15 --- Verbose(3): Create node /content/2012/201212/20121219_lh_lu_1442.pdf/jcr.content/renditions/orignal - Exists=false
    Exception in thread "main" javax.jcr.nodetype.ConstraintViolationException: no matching child node definition found for {}orignal
        at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQNodeDefinition(ItemDefinitionProviderImpl.java:201)
        at org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProviderImpl.getQNodeDefinition(ItemDefinitionProviderImpl.java:90)
        at org.apache.jackrabbit.jcr2spi.NodeImpl.createNode(NodeImpl.java:1444)
        at org.apache.jackrabbit.jcr2spi.NodeImpl.addNode(NodeImpl.java:187)
        at com.lsy.test.lnnreader.lufthanseat.CRXrepository.addArchiveFolder(CRXrepository.java:120)
    I've no idea, why this program fails. The node ../original is already there; have added it with CRXDE Explorer. Saving there didn't work before adding jcr.content with the property "jcr:data". But now you can see that there is a difference in the validating the existence of the relative path "original" in the ongoing routine (results in "Exists=false") and in the "listChildren-method" called immediately after validating the "renditions". This routines results in "Exists=true" for the node "original".
    So I've got two questions left: What do I need to do to add the node with the WebDAV-Connected program and how can I make sure it recognizes correctly the existence of a node
    best regards,
    Ulrich

    I am not sure why you have used addNode method on same parentNode two times (line by line) because you already have added node in first line and now you have to save it. May be this is causing issue.
    parentNode = parentNode.addNode("orignal", "nt:file"); 
    parentNode.addNode("orignal", "nt:file");
    let me know if it does not help you.

  • 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 text to a text node

    hi
    apologies for the simple question
    ive been searching endlessly for how to add text to a text node
    so far I have
    text body = doc.createTextNode("mynodename");
    previous_element.appendChild(body);
    but what mthod do i use to put in the string beween ie
    <mynodename>how do i put a string in here</mynodename>
    thanks

    elem = doc.createElement("mynodename");
    elem.appendChild(doc.createTextNode("how do i put a string in here"));
    doc.appendChild(elem);

  • Cannot Access Shortcut Menu for Adding Input/Output in Formula Node

    This is a wierd problem. I cannot access the shortcut menu in formula node. I right click the border, nothing happens. Anyone run into this before? Is there any other way to add inputs and outputs?
    I am running Vision Builder AI and want to use a formula node in my calculator tool.
    Solved!
    Go to Solution.

    As the saying goes, "when you hear hoofbeats, think horses and not zebras".  Let's get a few things out of the way.
    Is the VI in edit mode?
    Is autotool on?
    Drop a fresh FN on a New VI and try it again.
    The only other way I know to add/remove inputs is scripting, let's not go there.
    I have had a few issues with context menus, very few which persisted past a LV and/or computer restart, so I won't rule out a zebra just yet.

  • Adding vertical scrollbar using windows.open

    I have some simple code to open a new window in .aspx using the Windows.open function in SharePoint 2010. I need to add the scrollbars (especially the vertical one) but have been unable to figure out how to accomplish this. As you can see from
    my code below I have set the scrollbar to 1 which I understand to mean 'Yes' but I still see no scrollbar.
    Thanks.
    <%@ Page Language="C#" %>
    <html>
    <head runat="server">
    <meta name="WebPartPageExpansion" content="full" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body onLoad="OpenPage();">
    <script language="javascript" >
    //window.onload = function () { OpenPage(); }
    function OpenPage()
    var heightnum = screen.height;
    var widthnum = screen.width;
    var leftpos = screen.width/2 - 1500/2;
    var toppos = screen.height/2 - 800/2;
    window.open ("http://loginsp1.aspx","mywindow","menubar=0,scrollbar=1,resizable=1,width=widthnum,height=heightnum,left='+leftpos+',top='+toppos");
    window.open('', '_parent', '');
    </script>
    <br>
    <br>
    <br>
    <br>
    <form id="form1" runat="server">
    </form>
    </body>
    </html>

    I should add that the window that opens is smaller than the full screen size so I don't know if that makes a difference or not. I saw on one page where it indicated that scrollbars only appear if the document is bigger than the screen.

  • Problem in adding icon to the tree node

    I am using pv.jfcx.PVNode to create the node.It has a default icon at the node.I need to replace the default
    icon with the gif file.so i have included root.setImageAt(new ImageIcon("plus.gif"), 0);
    .but this is not working still the default node icon remains .how do i paint my gif image?can any one help me?
    pv.jfcx.PVNode root = tree.getRoot();
              root.setImageAt(new ImageIcon("plus.gif"), 0);
              pv.jfcx.PVNode one = new pv.jfcx.PVNode("Node 1");
              one.add(new pv.jfcx.PVNode("One"));
              one.add(new pv.jfcx.PVNode("Two"));
              one.add(new pv.jfcx.PVNode("three"));
              root.add(one);

    What is the class pv.jfcx.PVNode? Maybe I missed something along the line.
    But for Trees you can usually use the method of your TreeCellRenderer to set icon. The method are setOpenIcon, SetCLosedIcon, and setLeafIcon, and mainly setIcon.

  • Re: adding a scrollbar to layout area

    ohh and before you all think im crazy the text is just example text untill i get it right lol thanks again for any replies to this :) oh and i know the programming is really messy but im just starting out with the java!!

    Scroll bars in portlets is not something that is directly supported. You can have your portlet content display inside an iFrame. A sample iFrame portlet is included in the PDK.
    If you have questions about portlet development, please post them to the PDK forum.
    Regards,
    Jerry

  • Scrollbar in a classic Apex 4.1 tree

    In Apex 4.1 it looks like it is not possible for a new Apex 4.1 tree to adjust its template HTML settings.
    It can't be found in the shared components for instance.
    To be able to change some of the html style settings you can add a javascript in the "Execute when Page Loads" javascript settings of the page where the tree is located.
    Here is an example of adding a scrollbar to an Apex 4.1 tree:
    // Get div element of the tree. You can use firebug to determine the id of the tree
    d = document.getElementById('tree160968347950446047');
    // Show scrollbars when the tree data extends the maximum height
    // If you only need a vertical bar you can use 'overflowY' instead
    d.style.overflow="auto";
    // Set the width of the tree
    d.style.width="500px";
    // Set maximum height of the tree
    d.style.maxHeight="460px";
    // Microsoft Internet Explorer ignores the maxHeight style. So use height instead.
    // To avoid that the other browsers use this height style, give the height 1 px more than the maxHeight
    d.style.height="461px";
    Regards,
    Mathieu

    Hi Mathieu,
    Any chance that you might know the code to move the selected tree node to the top of the scrollbar region? I've done it previously as per
    APEX Tree.  Keep focus on expanded leaf node.
    but don't know where to put all this code now that we do not have access to the tree templates in V4+
    regards
    Paul P

  • How to execute custom code only when a specific node is selected in infoset

    Hi,
    We have written a piece of custom code under a node (P1045). Not all users will have access to this Infotype as it is related to Appraisals. So, when users (w/no access to 1045) try to run a Query for other info types data, they are getting error message 'Can not access 1045'. Custom code is getting generated whenever user runs a query. Tried to control custom code with simple IF condition by giving user name. Still generating 1045 code.
    All users use same infoset, where a group of users has access to 1045 and another group does not have access to 1045.
    Appreciate your inputs to get this resolved.
    Thanks,
    Swapna.

    Why don't you try another aproach, instead of adding the infotype to the infoset, create a new table as an alias (with the fields you want to show in regards to infotype 1045) and fill it in the node depending on the authorization check for that infotype in the code ?
    I think that adding the infotype as a node will always get the data from the infotype regardless, that is why it's showing the error.

  • [SOLVED] Can't add a node to the cluster with error (Exchange 2010 SP3 DAG Windows Server 2012)

    Hi there!
    I have a problem which makes me very angry already :)
    I have two servers Exchange 2010 SP3 with MB role started on Windows Server 2012. I decided to create a DAG.
    I have created the prestaged AD object for the cluster called msc-co-exc-01c, assigned necessary permissions and disabled it. Allowed through the Windows Firewall traffic between nodes and prepared the File Share Witness server.
    Then I have tried to add nodes. The first node has been added successfully, but the second node doesn't want to be added :). Now I can add only one node to the DAG. I tried to add different servers first, but only the first one was added.
    LOGS on the second nodes: 
    Application Log
    "Failed to initialize cluster with error 0x80004005." (MSExchangeIS)
    Failover Clustering Diagnostic Log
    "[VER] Could not read version data from database for node msc-co-exc-04v (id 1)."
    CMDLET Error:
    Summary: 1 item(s). 0 succeeded, 1 failed.
    Elapsed time: 00:06:21
    MSC-CO-EXC-02V
    Failed
    Error:
    A database availability group administrative operation failed. Error: The operation failed. CreateCluster errors may result from incorrectly configured static addresses. Error: An error occurred while attempting a cluster operation. Error: Cluster API '"AddClusterNode()
    (MaxPercentage=100) failed with 0x5b4. Error: This operation returned because the timeout period expired"' failed. [Server: msc-co-exc-04v.int.krls.ru]
    An Active Manager operation failed. Error An error occurred while attempting a cluster operation. Error: Cluster API '"AddClusterNode() (MaxPercentage=100) failed with 0x5b4. Error: This operation returned because the timeout period expired"' failed..
    This operation returned because the timeout period expired
    Click here for help... http://technet.microsoft.com/en-US/library/ms.exch.err.default(EXCHG.141).aspx?v=14.3.174.1&t=exchgf1&e=ms.exch.err.ExC9C315
    Warning:
    Network name 'msc-co-exc-01c' is not online. Please check that the IP address configuration for the database availability group is correct.
    Warning:
    The operation wasn't successful because an error was encountered. You may find more details in log file "C:\ExchangeSetupLogs\DagTasks\dagtask_2014-11-17_13-54-56.543_add-databaseavailabiltygroupserver.log".
    Exchange Management Shell command attempted:
    Add-DatabaseAvailabilityGroupServer -MailboxServer 'MSC-CO-EXC-02V' -Identity 'msc-co-exc-01c'
    Elapsed Time: 00:06:21
    UPD:
    when Exchange servers ran on the same Hyper-V node, the DAG is working well, but if I move one of VM to another node, It stops working.
    I have installed Wireshark and captured trafic of cluster interface. When DAG members on the same HV-node, there is inbound and outbound traffic on the cluster interface, but if I move one of DAG member to another node, in Wireshark I see only outbound traffic
    on both nodes.
    It's confused me, because there is normal connectivity between these DAG members through the main interface.
    Please, help me if you can.

    Hi, Jared! Thank you for the reply.
    Of course I did it already :) I have new info:
    when Exchange servers ran on the same Hyper-V node, the DAG is working well, but if I move one of VM to another node, It stops working.
    I have installed Wireshark and captured trafic of cluster interface. When DAG members on the same HV-node, there is inbound and outbound traffic on the cluster interface, but if I move one of DAG member to another node, in Wireshark I see only outbound traffic
    on both nodes.
    It's confused me, because there is normal connectivity between these DAG members through the main interface.

Maybe you are looking for

  • Apple disabled Apple ID when moved to new one, can not delete old from iPad

    Followed apple process to move Apple Id to a new email on my Macbook Pro.. Now can't login with original apple ID to turn off find my iPad. Appears Apple disabled it, since I know the password. Attempted to also login on Macbook Pro using the (old)pr

  • Item renderer in datagrid with actionscript

    Hi I want to implement a datagrid similar to the one given int the starting flex examples but in actionscript. I am having a problem with the itemRenderer. I can't figure it out how I cam create a imagerender in a datagridcolumn. My code is: var data

  • TS3367 Can't get sound on face time

    Can't hear the other person I'm talking to on face time

  • Address book scrolling corrupts list

    whenever i scroll through my addresses with my trackpad, mouse or tablet, the addresses blur and become unreadable. clicking on the address column snaps it back into focus, but further scrolling corrupts it again. if i switch from "view card & column

  • IMac shuts down completely.

    My iMac will completely shut down after a while if I go to the closed apple and click on sleep. It will also completely shut down if I leave the screen up and the computer puts it in sleep mode. It doesn't shut down instatantly, it will stay in sleep