How to Add Horizontal scrollbar to JTextPane

when i try to add Horizontal scrollbar to JTextPane it is not apperaing..plase help me..
nagesh

I tried in all ways
1)HORIZONTAL_SCROLLBAR_ALWAYS and VERTICAL_SCROLLBAR_ALWAYS
2)JTextPane textPane = new JTextPane();
JScollPane scroller = new JScrollPane(textPane);
or :
3)JScollPane scroller = new JScrollPane(textPane, VERTICAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_ALWAYS);
4)JScrollPane.setHorizontalScrollBarPolicy(
               ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
               JScrollPane.setVerticalScrollBarPolicy(
               ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
and also we tried to overwrite the setbounds also, but nothing is diplaying..

Similar Messages

  • How can I add horizontal scrollbars to pop-up windows?

    When I generate WebHelp, the pop-up windows that I created in the help have vertical scrollbars but no horizontal scrollbars. It hasn't been a problem for me, but another user told me that the pop-up boxes are running off the screen to the right and without the horizontal scroll bars, he can't read all of the text.

    Yes you can but you'd need to add some JavaScript to your topic. Either that or amend the code already there. You should be aware though that there maybe differences in how they operate in different browsers. You maybe better off trying to change the size of your popups or adjusting the content in them. You can set a popup to any size by using the Custom Sized Popup option when creating the link.

  • How to add vertical scrollbar to a tree region

    Hi,
    I have a page containing two regions. The first is a tree region displayed on the left hand side of the page. The second is form region displayed to the right of the tree, showing details relating to the selected node from the tree.
    How can I add a vertical scrollbar to the tree, so that I can I browse all nodes in the tree without affecting the position of the form? Currently, if my tree extends beyond the height of the page I have to use the page vertical scrollbar to view the bottom of the tree. This obviously means that the form is no longer in view.
    Thanks
    Andrew.

    Hi Andrew,
    You can't add a scrollbar directly to the region's contents, but you can wrap the contents within a DIV tag.
    In the Region Header add in:
    <DIV style="height:500px; overflow:auto">
    In the Region Footer add in:
    </DIV>
    Obviously, change the height value to suit your needs.
    Regards
    Andy

  • How to add attributed string to JTextPane

    Hi all,
    Could you tell me how to add an attributed string into a Textpane.
    Textpane only takes a styledDocument. Is there any way to convert attributed string into a styled document.
    Are there any components , which we can include attributed string , instead of simple string. Becoz i want my text to have variable fonts.

    Hello,
    check this short course about [url http://developer.java.sun.com/developer/onlineTraining/GUI/Swing2/shortcourse.html#JFCStyled]JTextPane and StyledDocument.
    Heres a small example:import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.event.*;
    public class AttributedStringTest extends JFrame
         public static void main(String[] args)
              new AttributedStringTest();
         private JTextPane textPane = null;
         private StyledDocument doc = null;
         AttributedStringTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initMenuBar();
              initTextPane();
              setSize(500, 300);
              setLocationRelativeTo(null);
              setVisible(true);
         private void initMenuBar()
              JMenuBar mbar = new JMenuBar();
              JMenu menu = new JMenu("StyleConstants");
              JMenuItem item = new JMenuItem("Color");
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        Color color =
                             JColorChooser.showDialog(
                                  AttributedStringTest.this,
                                  "Color Chooser",
                                  Color.cyan);
                        if (color != null)
                             MutableAttributeSet attr = new SimpleAttributeSet();
                             StyleConstants.setForeground(attr, color);
                             textPane.setCharacterAttributes(attr, false);
              menu.add(item);
              JMenu font = new JMenu("Font");
              font.add(item = new JMenuItem("12"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-12", 12));
              font.add(item = new JMenuItem("24"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-24", 24));
              font.add(item = new JMenuItem("36"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-36", 36));
              font.addSeparator();
              font.add(item = new JMenuItem("Serif"));
              item.setFont(new Font("Serif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"));
              font.add(item = new JMenuItem("SansSerif"));
              item.setFont(new Font("SansSerif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"));
              font.add(item = new JMenuItem("Monospaced"));
              item.setFont(new Font("Monospaced", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"));
              font.addSeparator();
              menu.add(font);
              mbar.add(menu);
              setJMenuBar(mbar);
         private void initTextPane()
              doc = new DefaultStyledDocument();
              textPane = new JTextPane(doc);
              JScrollPane scroll = new JScrollPane(textPane);
              getContentPane().add(scroll);
              final JTextField text = new JTextField();
              text.setToolTipText("Please enter something");
              text.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             doc.insertString(doc.getLength(), text.getText(), textPane.getInputAttributes());
                        } catch (BadLocationException bad)
              getContentPane().add(text, BorderLayout.SOUTH);
    //not formatted version:import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.event.*;
    public class AttributedStringTest extends JFrame
         public static void main(String[] args)
              new AttributedStringTest();
         private JTextPane textPane = null;
         private StyledDocument doc = null;
         AttributedStringTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initMenuBar();
              initTextPane();
              setSize(500, 300);
              setLocationRelativeTo(null);
              setVisible(true);
         private void initMenuBar()
              JMenuBar mbar = new JMenuBar();
              JMenu menu = new JMenu("StyleConstants");
              JMenuItem item = new JMenuItem("Color");
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        Color color =
                             JColorChooser.showDialog(
                                  AttributedStringTest.this,
                                  "Color Chooser",
                                  Color.cyan);
                        if (color != null)
                             MutableAttributeSet attr = new SimpleAttributeSet();
                             StyleConstants.setForeground(attr, color);
                             textPane.setCharacterAttributes(attr, false);
              menu.add(item);
              JMenu font = new JMenu("Font");
              font.add(item = new JMenuItem("12"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-12", 12));
              font.add(item = new JMenuItem("24"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-24", 24));
              font.add(item = new JMenuItem("36"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-36", 36));
              font.addSeparator();
              font.add(item = new JMenuItem("Serif"));
              item.setFont(new Font("Serif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"));
              font.add(item = new JMenuItem("SansSerif"));
              item.setFont(new Font("SansSerif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"));
              font.add(item = new JMenuItem("Monospaced"));
              item.setFont(new Font("Monospaced", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"));
              font.addSeparator();
              menu.add(font);
              mbar.add(menu);
              setJMenuBar(mbar);
         private void initTextPane()
              doc = new DefaultStyledDocument();
              textPane = new JTextPane(doc);
              JScrollPane scroll = new JScrollPane(textPane);
              getContentPane().add(scroll);
              final JTextField text = new JTextField();
              text.setToolTipText("Please enter something");
              text.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             doc.insertString(doc.getLength(), text.getText(), textPane.getInputAttributes());
                        } catch (BadLocationException bad)
              getContentPane().add(text, BorderLayout.SOUTH);
    regards
    Tim

  • How to create Horizontal scrollbar

    I am using Form6i, how to create a horizontal scrollbar for a multi-record block?
    Thanks!

    A horizontal scroll bar is not an object that you can drag or resize like a vertical scrollbar. It is implicitly created when needed.
    To get a horizontal scroll bar, you have to place the items you want to scroll on a STACKED CANVAS and set property Show Horizontal Scroll Bar of this canvas to Yes.

  • Rich:toolBar in a JSF page:how to avoid horizontal scrollbars?

    Hi,
    I have a rich:toolBar. I create this toolbar from a backing bean class. I have around 19 dropdown menus in the toolbar. So when the toolbar renders, the length (i mean, width) of the toolbar exceeds the page width. This causes the browser to add a horizontal scrollbar. I do not want this scrollbar. My requirement is like this:
    when the width of the toolbar is more than the screen width, the rest of the menus must be added to another DropdownMenu.This menu will be the last menu and it will contain all the menus which cant be viewed when the toolbar is rendered.
    When we use overflow : hidden, it removes the scrollbar in firefox not in IE. If you are not clear about the requirement, you can see the firefox browser itself as one with the similar feature. when we open more tabs than it is able to render, the tabs which are not shown are added to a 'button' to the right of the browser window.
    Please help me with your ideas.
    Thanks,
    Geet

    the overflow : hidden worked well(actually not well, i was not able to see the menu items)on my firefox browser. but it didnt work on my IE. and my firefox version is 3.

  • How to enable horizontal SCROLLBAR in JPC simplegraph bean

    Hi,
    I've been trying to enable the scroll bar in Oracle Forms 10g which uses Oracle JPC simplegraph bean but unfortunately i'm still having an unreadable graph when the columns increases because no scroll bar is activated and the columns appear in a line shape.
    I'm using the following line of code just before the call to draw the graph and still the scroll bar doesn't appear.
    SET_CUSTOM_PROPERTY('CONTROL.SIMPLEGRAPH',1,'SCROLLBAR','true');
    FORMSGRAPHSAMPLE.setGraphType('CONTROL.SIMPLEGRAPH','VERTICAL_STACKED_BAR');
    FORMSGRAPHSAMPLE.populateSimpleGraphData('CONTROL.SIMPLEGRAPH',:CONTROL.CUSTOMERS,',');
    Can anyone advice how can i solve my problem.
    Thanks
    Lanlani

    Hii everyone !!!
    I'm still stuck please helppppppppp
    Thanks

  • How to add a scrollbar to 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.length()) { // delete all processed chars from typeAhead
    typeAhead.setLength(0);
    } else {
    int len = typeAhead.length();
    for (int i = pos; i < len; i++) {
    typeAhead.setCharAt(i - pos, typeAhead.charAt(i));
    typeAhead.setLength(len - pos);
    return lineBuffer.toString(); // return the string that was entered
    protected synchronized void doKey(char ch) { // process key pressed by user
    typeAhead.append(ch);
    notify();
    private void putCursor(Graphics g) { // draw the cursor
    g.drawLine(leftOffset + currentCol * charWidth + 1,
    topOffset + (currentRow * lineHeight),
    leftOffset + currentCol * charWidth + 1,
    topOffset + (currentRow * lineHeight + baseOffset));
    protected synchronized void putChar(char ch) { // draw ch at cursor position and move cursor
    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 (currentCol >= columns) {
    putCR();
    currentCol++;
    Graphics g = getGraphics();
    g.setColor(Color.black);
    g.setFont(font);
    char[] fudge = new char[1];
    fudge[0] = ch;
    g.drawChars(fudge, 0, 1, leftOffset + (currentCol - 1) * charWidth,
    topOffset + currentRow * lineHeight + baseOffset);
    g.dispose();
    OSCGraphics.drawChars(fudge, 0, 1,
    leftOffset + (currentCol - 1) * charWidth,
    topOffset + currentRow * lineHeight + baseOffset);
    protected void eraseChar() { // erase char before cursor position and move cursor
    if (currentCol == 0 && currentRow == 0) {
    return;
    currentCol--;
    if (currentCol < 0) {
    currentRow--;
    currentCol = columns - 1;
    Graphics g = getGraphics();
    g.setColor(Color.white);
    g.fillRect(leftOffset + (currentCol * charWidth),
    topOffset + (currentRow * lineHeight),
    charWidth, lineHeight - 1);
    g.dispose();
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(leftOffset + (currentCol * charWidth),
    topOffset + (currentRow * lineHeight),
    charWidth, lineHeight - 1);
    OSCGraphics.setColor(Color.black);
    protected synchronized void putCR() { // move cursor to start of next line, scrolling window if necessary
    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();
    currentCol = 0;
    currentRow++;
    if (currentRow < rows) {
    return;
    OSCGraphics.copyArea(leftOffset, topOffset + lineHeight,
    columns * charWidth,
    (rows - 1) * lineHeight - leading, 0, -lineHeight);
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(leftOffset, topOffset + (rows - 1) * lineHeight,
    columns * charWidth, lineHeight - leading);
    OSCGraphics.setColor(Color.black);
    currentRow = rows - 1;
    Graphics g = getGraphics();
    paint(g);
    g.dispose();
    try {
    Thread.sleep(20);
    } catch (InterruptedException e) {}
    protected void cursorBlink() { // toggle visibility of cursor (but don't show it if focus has been lost)
    if (cursorIsVisible) {
    Graphics g = getGraphics();
    g.setColor(Color.white);
    putCursor(g);
    cursorIsVisible = false;
    g.dispose();
    } else if (hasFocus) {
    Graphics g = getGraphics();
    g.setColor(Color.black);
    putCursor(g);
    cursorIsVisible = true;
    g.dispose();
    protected synchronized void doFocus(boolean focus) { // react to gain or loss of focus
    if (OSC == null) {
    doSetup();
    hasFocus = focus;
    if (hasFocus) { // the rest of the routine draws or erases border around canvas
    OSCGraphics.setColor(Color.cyan);
    } else {
    OSCGraphics.setColor(Color.white);
    int w = getSize().width;
    int h = getSize().height;
    for (int i = 0; i < 3; i++) {
    OSCGraphics.drawRect(i, i, w - 2 * i, h - 2 * i);
    OSCGraphics.drawLine(0, h - 3, w, h - 3);
    OSCGraphics.drawLine(w - 3, 0, w - 3, h);
    OSCGraphics.setColor(Color.black);
    repaint();
    try {
    Thread.sleep(50);
    } catch (InterruptedException e) {}
    notify();
    protected void doSetup() { // get font parameters and create OSC
    int w = getSize().width;
    int h = getSize().height;
    font = new Font("Courier", Font.PLAIN, getFont().getSize());
    FontMetrics fm = getFontMetrics(font);
    lineHeight = fm.getHeight();
    leading = fm.getLeading();
    baseOffset = fm.getAscent();
    charWidth = fm.charWidth('W');
    columns = (w - 12) / charWidth;
    rows = (h - 12 + leading) / lineHeight;
    leftOffset = (w - columns * charWidth) / 2;
    topOffset = (h + leading - rows * lineHeight) / 2;
    OSC = createImage(w, h);
    OSCGraphics = OSC.getGraphics();
    OSCGraphics.setFont(font);
    OSCGraphics.setColor(Color.white);
    OSCGraphics.fillRect(0, 0, w, h);
    OSCGraphics.setColor(Color.black);
    notify();
    public void update(Graphics g) {
    paint(g);
    public synchronized void paint(Graphics g) {
    if (OSC == null) {
    doSetup();
    g.drawImage(OSC, 0, 0, this);
    private void jbInit() throws Exception {
    ===============================================================
    and finally Consola:
    package myproj;
    /* The Consola provides a basis for writing applets that simulate
    line-oriented consola-type input/output. The class ConsoleCanvas is
    used to provide the I/O routines; these routines type output into
    the ConsoleCanvas and read input typed there by the user. See the
    files CanvasPanel.java and ConsoleCanvas.java for information.
    A consola applet is set up to run one particular program. The applet
    includes a button that the user presses to run the program (or to
    abort it when it is running). It also includes a label, which by default
    is "Java I/O consola". The default program, defined in this file,
    is a simple Hello World program.
    To write a new consola applet, with a more interesting program, you
    should create a subclass of Consola. The subclass should
    override the method program() , which represents the program to
    be run. The program should use the instance variable, consola, to
    do input/output. For example, consola.putln("HelloWorld.")
    or N=consola.getInt(). All the public methods of class ConsolePanel
    can be called in the program.
    (Of course, you could also just modify this file, instead of
    writing a subclass.)
    import java.awt.*;
    import java.awt.event.*;
    import myproj.ConsoleCanvas;
    import myproj.ConsolePanel;
    import java.util.*;
    import javax.swing.JScrollPane;
    import javax.swing.JList;
    import javax.swing.*;
    import java.io.*;
    public class Consola extends java.applet.Applet implements Runnable,
    ActionListener {
    public Consola() {
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    protected String title = "Configure Vlan "; // (Used for compatibility with previous versions of consola Applet)
    protected String getTitle() {
    // Return a label to appears over the consola;
    // If you want to change the label, override this
    // method to return a different string.
    return title;
    //variabilele mele
    static String[] Foo={"Fa0/1","Fa0/2","Fa0/3","Fa0/4","Fa0/5","Fa0/6","Fa0/7","Fa0/8","Fa0/9","F a0/10","Fa0/11","Fa0/12"};
    static String[] vlan={"","","","","","","","","","","",""};
    static String [] showdefault={"","","","","","","","","","","",""};
    stat

    First thing...you made a mistake
    import javax.swing.JScrollPane;
    import javax.swing.JScrollBar;
    import javax.swing.*;When you import javax.swing.*; You automatically
    import JScrollPane & JScrollBar class, there's no
    need for you to re import again...
    That is not always a mistake. There are cases where it makes sense to do both (i.e., to import both '*' and a specific class name from that package at the same time). I believe the common example is:
    import java.awt.*;
    import java.util.*;
    import java.util.List;Now you can use "List" as a short name for "java.util.List", but must use "java.awt.List" in full for "java.awt.List" objects. If you just did:
    import java.awt.*;
    import java.util.*;Then you couldn't use List as a short name for anything--because it is ambiguous. You'd have to use both "java.awt.List" and "java.util.List" spelled out in full.
    Or, if you did:
    import java.awt.*;
    import java.util.*;
    import java.awt.List; // NOTE CHANGEThen "List" is short for "java.awt.List", and you must use "java.util.List" in full for "java.awt.List" objects.

  • How to add scrollbar to jpopup menu

    Hi everyone,
    Do u know how to add a scrollbar to jpopup menu ?

    Menus don't scroll, and shouldn't scroll. Given that, you shouldn't try and use JPopupMenu at all... rather, create your own component that implements the look and behavior you want. It will be far easier and less frustrating.
    Either that... or you should re-think what functionality you are trying to provide, and how you are trying to implement it. A scrolling menu just seems like a counterintuitive wacky UI design to me.

  • ADF selectmanylistbox with horizontal scrollbar

    <af:selectManyListbox value="#{tree.lstValus}" size="10" inlineStyle="width:260px">
    I have that, if I have more then values 10. a vertical scrollbar will be shown.But in case a value is larger then the selectmanylistbox no horizontal scrollbar shows up.
    If i remove the width, the selectmanylistbox horizontal size is based on length of longest value. But I dont want to remove the width, as it affects my page and style of my page.
    I just need to know how can i add horizontal scrollbar to af:selectmanylistbox

    Hi,
    don' t think you can add this. What's your JDeveloper release ?
    Frank

  • Horizontal scrollbar on tab page

    Hi,
    I'd like to use Designer for a multi-record block on a tab page with a horizontal scrollbar . How should I do this ? It is alright for a vertical scrollbar but what about an horizontal one ? Since I have too many columns to display on one tabbed page.
    Thank you,
    Denise

    If you have many items that they cannot fit into a tab page, I think you have to put them into a Stacked Canvas. This can be done by changing Overflow Style to "Spread table" option in The Module Component containing these items.
    Also, you can set WINHSB Module Generator Preference to 'Y' value to add horizontal scrollbar to module Window.
    I hope you found solution for your problem.

  • Horizontal Scrollbar in a JTextPane

    How can I specify whether or not there is a horizontal scrollbar for a JTextPane? The JTextPane is held within a JScrollPane, but if I try and do:
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    I just end up with a pointless scrollbar on the JScrollPane which doesn't do anything, because the text in the JTextPane still wraps onto the next line.
    Any ideas?
    Thank-you.

    Use this code to cancel the line wrapping of the text pane.
    JTextPane textPane = new JTextPane() {
        public boolean getScrollableTracksViewportWidth() {
            return false;
        public void setSize(Dimension d) {
            if (d.width < getParent().getSize().width)
                d.width = getParent().getSize().width;    
            super.setSize(d);
    };

  • How to set the extra component to horizontal scrollbar position

    How to set the component to position of horizontal scrollbar , that position contain two component horizontal scrollbar and any component (JButton , JLabel ) like that.. Ms-Word scrollbar ,
    Like that bellow fig.
    <!--[if !mso]>
    <style>
    v\:* {behavior:url(#default#VML);}
    o\:* {behavior:url(#default#VML);}
    w\:* {behavior:url(#default#VML);}
    .shape {behavior:url(#default#VML);}
    </style>
    <![endif]--><!--[if gte mso 9]><xml>
    <w:WordDocument>
    <w:View>Normal</w:View>
    <w:Zoom>0</w:Zoom>
    <w:PunctuationKerning/>
    <w:ValidateAgainstSchemas/>
    <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
    <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
    <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
    <w:Compatibility>
    <w:BreakWrappedTables/>
    <w:SnapToGridInCell/>
    <w:WrapTextWithPunct/>
    <w:UseAsianBreakRules/>
    <w:DontGrowAutofit/>
    </w:Compatibility>
    <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
    </w:WordDocument>
    </xml><![endif]--><!--[if gte mso 9]><xml>
    <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
    </w:LatentStyles>
    </xml><![endif]-->
    <!--
    /* Style Definitions */
    p.MsoNormal, li.MsoNormal, div.MsoNormal
    {mso-style-parent:"";
    margin:0in;
    margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:12.0pt;
    font-family:"Times New Roman";
    mso-fareast-font-family:"Times New Roman";}
    @page Section1
    {size:8.5in 11.0in;
    margin:1.0in 1.25in 1.0in 1.25in;
    mso-header-margin:.5in;
    mso-footer-margin:.5in;
    mso-paper-source:0;}
    div.Section1
    {page:Section1;}
    -->
    <!--[if gte mso 10]>
    <style>
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin:0in;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:10.0pt;
    font-family:"Times New Roman";
    mso-ansi-language:#0400;
    mso-fareast-language:#0400;
    mso-bidi-language:#0400;}
    </style>
    <![endif]-->{font:'Times New Roman'}{size:12pt}<!--[if gte vml 1]><v:shapetype id="_x0000_t75"
    coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
    filled="f" stroked="f">
    <v:stroke joinstyle="miter"/>
    <v:formulas>
    <v:f eqn="if lineDrawn pixelLineWidth 0"/>
    <v:f eqn="sum @0 1 0"/>
    <v:f eqn="sum 0 0 @1"/>
    <v:f eqn="prod @2 1 2"/>
    <v:f eqn="prod @3 21600 pixelWidth"/>
    <v:f eqn="prod @3 21600 pixelHeight"/>
    <v:f eqn="sum @0 0 1"/>
    <v:f eqn="prod @6 1 2"/>
    <v:f eqn="prod @7 21600 pixelWidth"/>
    <v:f eqn="sum @8 21600 0"/>
    <v:f eqn="prod @7 21600 pixelHeight"/>
    <v:f eqn="sum @10 21600 0"/>
    </v:formulas>
    <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
    <o:lock v:ext="edit" aspectratio="t"/>
    </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:453pt;
    height:26.25pt'>
    <v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\04\clip_image001.png"
    o:title=""/>
    </v:shape><![endif]--><!--[if !vml]--><img src="file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/04/clip_image002.jpg" alt="" width="485" height="27" /><!--[endif]-->{size}{font}
    How to design ?

    pradeep.rajadurai wrote:
    I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
    give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude.

  • How can I create a horizontal scrollbar with a centered thumb that scrolls content from both sides?

    I am having trouble figuring out how to create a horizontal scrollbar component either by itself or nested inside a data list component that will have it's thumb centered in the track when running and reveal content from either the right or left side when the thumb is moved. The furthest I have managed to get is to create a data list component with a scrollbar component inside that has a centered thumb that reveals content from the right side of the list (0 through 10 of the items) but only reveals blank area when tracking the other way. Is there a way to create say… negative items in the data list… 0 through -10? Or am I approaching this the wrong way. Please help. Thanks.

    Mykola,
    Thanks. I guess I was hoping for an answer that addressed my question from a designer's point of view rather than a developers'. As a designer with over ten years experience using Adobe products for print work it is difficult to understand why "centered" is such a complicated concept when designing art for use on the web. It is so frustrating to realize that most containers for images and text can only be resized by pushing and pulling handles located on the right and bottom; Catalyst seems like a great start but if Adobe really wanted to impress the "design" community it might consider putting all that supercharged code underneath the hood of some more familiar "design" tools. Maybe a "catalytic converter" would allow the introduction of a "centered" tool for every element.
    After all, why is it literally twenty-five times more difficult, requiring the use of three additional programs to create a component that functions exactly like a typical data list and scroll bar with the exception that the thumb is "centered" on the track and reveals images from both the right and left. For that matter why not also have as an option a thumb that snaps to the bottom of the track and reveals images from the top… and one that snaps to the right and reveals images from the left when you run the project? It just seems so logical to expand the scroll bar component to include these options.
    I am very glad to have Catalyst and will redesign my project to fit within the constraints of the tools available in the program but it seems that if Adobe is really serious about Catalyst being a window into the world of web design for designers/AD's that perhaps it might benefit by focusing on what might improve the program from the designer's point of view. I hate to say it but the Catalyst forum is already rife with answers to questions that are riddled with code… Literally. And to be honest most designers don't have the time to decipher that code. As a designer I work regularly and have a deep understanding of Photoshop, InDesign, Illustrator, Acrobat Pro, Final Cut Pro, Final Draft and modo. I do hi-res assembly, retouching, design and layout, identity, production, 3D modeling and rendering, video editing… and before I switch to using Catalyst for web mock-ups I am going to need a more "designer" friendly set of tools and definitely a "centered" control.
    I really think Adobe is fantastic. But I also think it could take a lesson from a great little company called Luxology. I tried learning 3D modeling and rendering for years with programs like Lightwave, Maya and others, always with mixed results. Then Luxology came along and actually delivered on their promise to create a 3D program for artists. What was the factor that made all the difference? Well, besides the Apple award winning interface and sets of tools it was the training available on their sight. The program itself ships with thirty-six hours of quicktime movies. And hundreds more hours available for download. I have never yet not been able to quickly and easily find an answer to a question I had about how to accomplish something in modo. You know how long I have already spent on Adobe TV searching through videos and on the Catalyst forum searching through topics trying to get an answer to what I thought was a very simple question? Way too many. If I have a question about a Luxology product that I can't find the answer to do you know what I do? I call Brad Peebler, the President of Luxology. I'm not special nor do I work for some special development house with special privileges that is simply their policy. And that policy has paid big dividends. Both ILM and Pixar has licensed their technology.
    Well… I apologize for this long response but I really think that if Catalyst is going to attract the market it wants that it will have to consider putting some designers on the development team. After all… Isn't that what the promo videos tout… Finally a web design program for designers. Well, I guess we'll see.
    Karl

  • Can i add a horizontal scrollbar?

    Hi,
    I have a datablock , Employees , having the fields
    SQL> desc employees
    Name                            Null?    Type
    EMPLOYEE_ID                     NOT NULL NUMBER(6)
    FIRST_NAME                               VARCHAR2(20)
    LAST_NAME                       NOT NULL VARCHAR2(25)
    EMAIL                           NOT NULL VARCHAR2(25)
    PHONE_NUMBER                             VARCHAR2(20)
    HIRE_DATE                       NOT NULL DATE
    JOB_ID                          NOT NULL VARCHAR2(10)
    SALARY                                   NUMBER(8,2)
    COMMISSION_PCT                           NUMBER(2,2)
    MANAGER_ID                               NUMBER(6)
    DEPARTMENT_ID                            NUMBER(4)I created a layout, using layout editor to display all the fields in tabular format. I could create a vertical scrollbar.
    but I also want a horizontal scrollbar.
    How can i create one?
    Thanks
    Edited by: user12984479 on Apr 17, 2010 1:26 AM
    Edited by: user12984479 on Apr 17, 2010 1:27 AM

    After creating the contant and stacked canvas as you said.
    a). Just open the department (contant) canvas and select from the menu View>Stacked Views.... It will show you that employee (stacked) canvas just choose that canvas and press ok. It will be on your main department canvas. Then adjust that canvas by keyboard/mouse upon your requirement where you want to place.
    b). And for the tab key as you said. For this you will have to create one trigger called KEY-NEXT-ITEM. This trigger you will create from where you want to go to the employee canvas. Let say you want that after department name cursor should go to the employee canvan's any field. Then create trigger on department name field called KEY-NEXT-ITEM and in this trigger just write like this...
    GO_ITEM('<EMPLOYEE_BLOCK.FIELD_NAME>');  -- Change the name upon your block and field name in formHope this will work.
    -Ammad
    Edited by: Ammad Ahmed on Apr 18, 2010 8:22 AM

Maybe you are looking for