My JScrollpane wont scroll horizontally?

hmmmm...
As the title says, my JSCrollPane wont scroll horizontally. I've passed a customer "Drawer" object to it.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
public class gui extends JFrame{
     Container c;
     JPanel p;
     Drawer d;
     JComboBox box;
     JLabel lab;
     JScrollPane sp=new JScrollPane(p);
     String options[]={"Terminal","Non-Terminal","Repeat","Or"};
     ArrayList list=new ArrayList();
     String lastTerminal="";
     String lastNonTerminal="";
     int x=0;
     int y=350;
     boolean stupid=true;
     int pixelsize=0;
     String orString;
     ArrayList orStringList=new ArrayList();
     ArrayList orList=new ArrayList();
     boolean done=false;
     int count=0;
     int lastx=0;
     int lasty=0;
     public gui(){
          super("Something");
          setSize(900,700);
          c=getContentPane();
          c.setLayout(new BorderLayout(5,5));
          c.setBackground(Color.white);          
          p=new JPanel();
         d=new Drawer();
         box=new JComboBox(options);
         lab=new JLabel("Add:");
        box.addActionListener(new BoxListener());
        box.setOpaque(false);
         p.add(lab);
          p.add(box);
          sp=new JScrollPane(d);
          c.add(sp,BorderLayout.CENTER);
          c.add(p,BorderLayout.SOUTH);
          show();
     public class BoxListener implements ActionListener{
      public void actionPerformed(ActionEvent evt) {
           //if(!stupid){
            if (box.getSelectedIndex()==0)
                 lastTerminal=JOptionPane.showInputDialog("Enter your Terminal name");
                 list.add(new Terminal(lastTerminal,x,y,true));
                 Terminal tt=(Terminal)list.get(list.size()-1);
                 x=x+tt.getStringWidth()+45;
                 repaint();
            if (box.getSelectedIndex()==1)
                   lastNonTerminal=JOptionPane.showInputDialog("Enter your Non-Terminal name");
                 list.add(new Terminal(lastNonTerminal,x,y,false));
                 Terminal tt=(Terminal)list.get(list.size()-1);
                 x=x+tt.getStringWidth()+45;
                 repaint();
         if (box.getSelectedIndex()==3)
                   orStringList.clear();
                   orString=JOptionPane.showInputDialog("Enter your Or, seperate each Or with a |")+"|";
                   StringBuffer sb=new StringBuffer(orString);
                   while(sb.indexOf("|")!=-1)
                        orStringList.add(sb.substring(0,sb.indexOf("|")));
                        sb.delete(0,sb.indexOf("|")+1);
                   int eveny=y;
                    int oddy=y;
                    for(int i=1;i<orStringList.size()+1;i++)
                             if((i%2)==0)
                                       eveny=eveny+25;
                                       orList.add(new OrTerm((String)orStringList.get(i-1),x+35,eveny,false,x,y,x+130,y));
                              else
                                        oddy=oddy-25;
                                       orList.add(new OrTerm((String)orStringList.get(i-1),x+35,oddy,false,x,y,x+130,y));
                   OrTerm tt=(OrTerm)orList.get(orList.size()-1);
                 x=x+tt.getStringWidth()+100;
                   repaint();
     public static void main (String args[]) {
          gui app = new gui();
          app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     public class Drawer extends JPanel
          public Drawer()
               this.setBackground(Color.ORANGE);
     public void paint(Graphics g2)
         super.paint(g2);
         Graphics2D g=(Graphics2D)g2;
          g.setFont(new Font(null,Font.BOLD,15));
          Terminal temp=null;
          OrTerm temp2=null;
          for(int i=0;i<orList.size();i++)
                    temp2=(OrTerm)orList.get(i);
                    pixelsize=SwingUtilities.computeStringWidth(g.getFontMetrics(),temp2.getName());
                    g.drawString(temp2.getName(),temp2.getx(),temp2.gety());
                    g.drawRect(temp2.getx()-4,temp2.gety()-16,pixelsize+7,25);
                    g.drawLine(temp2.getx()-2,temp2.gety()-2,temp2.getx2()-5,temp2.gety2()-2);
                    g.drawLine(temp2.getx()+pixelsize+7,temp2.gety()-2,temp2.getx3(),temp2.gety3());
          for(int i=0;i<list.size();i++)
               temp=(Terminal)list.get(i);
               g.drawString(temp.getName(),temp.getx(),temp.gety());
               pixelsize=SwingUtilities.computeStringWidth(g.getFontMetrics(),temp.getName());
               if(temp.isTerminal()==true)
                 g.drawOval(temp.getx()-4,temp.gety()-16,pixelsize+7,25);
               else
                 g.drawRect(temp.getx()-4,temp.gety()-16,pixelsize+7,25);
               lastx=temp.getx()+pixelsize+7+30;
               lasty=y-2;
               //drawing line
               g.drawLine(temp.getx()+pixelsize+7,y-2,temp.getx()+pixelsize+7+30,y-2); 
             //drawing little array >
             g.drawLine(temp.getx()+pixelsize+7+30,y-2,temp.getx()+pixelsize+7+25,y-7);
              g.drawLine(temp.getx()+pixelsize+7+30,y-2,temp.getx()+pixelsize+7+25,y+5);
class Terminal {
     private String name;
     private int x2;
     private int y2;
     private boolean terminal;
     public Terminal(String name, int x, int y,boolean boo)
          this.name=name;
          this.x2=x;
          this.y2=y;
          this.terminal=boo;
     public String getName(){return this.name;}
     public int getx(){return this.x2;}
     public int gety(){return this.y2;}
     public int getStringWidth()
          return SwingUtilities.computeStringWidth(Toolkit.getDefaultToolkit().getFontMetrics(new Font(null,Font.BOLD,15)),this.name);
     public boolean isTerminal(){return this.terminal;}
class OrTerm {
     private String name;
     private int x;
     private int y;
     private int x2;
     private int y2;
     private int x3;
     private int y3;
     private boolean terminal;
     public OrTerm(String name, int x, int y,boolean boo,int x2,int y2,int x3,int y3)
          this.name=name;
          this.x=x;
          this.y=y;
          this.terminal=boo;
          this.x2=x2;
          this.y2=y2;
          this.x3=x3;
          this.y3=y3;          
     public String getName(){return this.name;}
     public int getx(){return this.x;}
     public int gety(){return this.y;}
     public int getx2(){return this.x2;}
     public int gety2(){return this.y2;}
     public int getx3(){return this.x3;}
     public int gety3(){return this.y3;}
     public int getStringWidth()
          return SwingUtilities.computeStringWidth(Toolkit.getDefaultToolkit().getFontMetrics(new Font(null,Font.BOLD,15)),this.name);
     public boolean isTerminal(){return this.terminal;}
     import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
public class gui extends JFrame{
     Container c;
     JPanel p;
     Drawer d;
     JComboBox box;
     JLabel lab;
     JScrollPane sp=new JScrollPane(p);
     String options[]={"Terminal","Non-Terminal","Repeat","Or"};
     ArrayList list=new ArrayList();
     String lastTerminal="";
     String lastNonTerminal="";
     int x=0;
     int y=350;
     boolean stupid=true;
     int pixelsize=0;
     String orString;
     ArrayList orStringList=new ArrayList();
     ArrayList orList=new ArrayList();
     boolean done=false;
     int count=0;
     int lastx=0;
     int lasty=0;
     public gui(){
          super("Something");
          setSize(900,700);
          c=getContentPane();
          c.setLayout(new BorderLayout(5,5));
          c.setBackground(Color.white);          
          p=new JPanel();
     d=new Drawer();
     box=new JComboBox(options);
     lab=new JLabel("Add:");
box.addActionListener(new BoxListener());
box.setOpaque(false);
     p.add(lab);
          p.add(box);
          sp=new JScrollPane(d);
          c.add(sp,BorderLayout.CENTER);
          c.add(p,BorderLayout.SOUTH);
          show();
     public class BoxListener implements ActionListener{
     public void actionPerformed(ActionEvent evt) {
          //if(!stupid){
          if (box.getSelectedIndex()==0)
     lastTerminal=JOptionPane.showInputDialog("Enter your Terminal name");
     list.add(new Terminal(lastTerminal,x,y,true));
     Terminal tt=(Terminal)list.get(list.size()-1);
     x=x+tt.getStringWidth()+45;
     repaint();
          if (box.getSelectedIndex()==1)
     lastNonTerminal=JOptionPane.showInputDialog("Enter your Non-Terminal name");
     list.add(new Terminal(lastNonTerminal,x,y,false));
     Terminal tt=(Terminal)list.get(list.size()-1);
     x=x+tt.getStringWidth()+45;
     repaint();
if (box.getSelectedIndex()==3)
          orStringList.clear();
          orString=JOptionPane.showInputDialog("Enter your Or, seperate each Or with a |")+"|";
          StringBuffer sb=new StringBuffer(orString);
          while(sb.indexOf("|")!=-1)
               orStringList.add(sb.substring(0,sb.indexOf("|")));
               sb.delete(0,sb.indexOf("|")+1);
          int eveny=y;
                    int oddy=y;
                    for(int i=1;i<orStringList.size()+1;i++)
                    if((i%2)==0)
                              eveny=eveny+25;
                              orList.add(new OrTerm((String)orStringList.get(i-1),x+35,eveny,false,x,y,x+130,y));
                              else
                                        oddy=oddy-25;
                              orList.add(new OrTerm((String)orStringList.get(i-1),x+35,oddy,false,x,y,x+130,y));
          OrTerm tt=(OrTerm)orList.get(orList.size()-1);
     x=x+tt.getStringWidth()+100;
          repaint();
     public static void main (String args[]) {
          gui app = new gui();
          app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     public class Drawer extends JPanel
          public Drawer()
               this.setBackground(Color.ORANGE);
public void paint(Graphics g2)
     super.paint(g2);
     Graphics2D g=(Graphics2D)g2;
          g.setFont(new Font(null,Font.BOLD,15));
     Terminal temp=null;
     OrTerm temp2=null;
          for(int i=0;i<orList.size();i++)
               temp2=(OrTerm)orList.get(i);
               pixelsize=SwingUtilities.computeStringWidth(g.getFontMetrics(),temp2.getName());
               g.drawString(temp2.getName(),temp2.getx(),temp2.gety());
               g.drawRect(temp2.getx()-4,temp2.gety()-16,pixelsize+7,25);
               g.drawLine(temp2.getx()-2,temp2.gety()-2,temp2.getx2()-5,temp2.gety2()-2);
               g.drawLine(temp2.getx()+pixelsize+7,temp2.gety()-2,temp2.getx3(),temp2.gety3());
     for(int i=0;i<list.size();i++)
          temp=(Terminal)list.get(i);
          g.drawString(temp.getName(),temp.getx(),temp.gety());
          pixelsize=SwingUtilities.computeStringWidth(g.getFontMetrics(),temp.getName());
          if(temp.isTerminal()==true)
          g.drawOval(temp.getx()-4,temp.gety()-16,pixelsize+7,25);
          else
          g.drawRect(temp.getx()-4,temp.gety()-16,pixelsize+7,25);
          lastx=temp.getx()+pixelsize+7+30;
          lasty=y-2;
          //drawing line
          g.drawLine(temp.getx()+pixelsize+7,y-2,temp.getx()+pixelsize+7+30,y-2);
     //drawing little array >
     g.drawLine(temp.getx()+pixelsize+7+30,y-2,temp.getx()+pixelsize+7+25,y-7);
     g.drawLine(temp.getx()+pixelsize+7+30,y-2,temp.getx()+pixelsize+7+25,y+5);
class Terminal {
     private String name;
     private int x2;
     private int y2;
     private boolean terminal;
     public Terminal(String name, int x, int y,boolean boo)
          this.name=name;
          this.x2=x;
          this.y2=y;
          this.terminal=boo;
     public String getName(){return this.name;}
     public int getx(){return this.x2;}
     public int gety(){return this.y2;}
     public int getStringWidth()
          return SwingUtilities.computeStringWidth(Toolkit.getDefaultToolkit().getFontMetrics(new Font(null,Font.BOLD,15)),this.name);
     public boolean isTerminal(){return this.terminal;}
class OrTerm {
     private String name;
     private int x;
     private int y;
     private int x2;
     private int y2;
     private int x3;
     private int y3;
     private boolean terminal;
     public OrTerm(String name, int x, int y,boolean boo,int x2,int y2,int x3,int y3)
          this.name=name;
          this.x=x;
          this.y=y;
          this.terminal=boo;
          this.x2=x2;
          this.y2=y2;
          this.x3=x3;
          this.y3=y3;          
     public String getName(){return this.name;}
     public int getx(){return this.x;}
     public int gety(){return this.y;}
     public int getx2(){return this.x2;}
     public int gety2(){return this.y2;}
     public int getx3(){return this.x3;}
     public int gety3(){return this.y3;}
     public int getStringWidth()
          return SwingUtilities.computeStringWidth(Toolkit.getDefaultToolkit().getFontMetrics(new Font(null,Font.BOLD,15)),this.name);
     public boolean isTerminal(){return this.terminal;}
     

Scrollbars will appear when the preferred size of the component is greater than the size of the scroll pane. If you are adding a custom drawn component to the scrollpane then you must set the preferredSize.

Similar Messages

  • JScrollPane wont scroll .. pls help

    hi to all,
    I have a scrollpane that i am displaying a graph in, and they will be large graphs, 10000 nodes with about cardinality 10 for each node.
    I can generate the graph output no problems but my scrollbars dont allow me to scroll the pane, and i cant figure out why.
    I'm assuming that i should be doing something with the viewport once i add the graph, but i dont know what.
    can anyone pls help me,
    also can anyone suggest how i go about zooming in and out. im thinking its just resizng the viewport, but i need to work out why i cant scroll before i tackle that.
    package graphappz.ui;
    import java.awt.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import graphappz.graph.Graph;
    import java.util.Iterator;
    import graphappz.graph.Vertex;
    import graphappz.graph.Edge;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseEvent;
    public class GraphWindow
        extends JPanel {
      JEditorPane graphWindow;
      JScrollPane graphView;
      Dimension d = new Dimension();
      Point2D p = null;
      GraphViewer viewer;
      public GraphWindow() {
        graphWindow = new JEditorPane();
        graphWindow.setText("");
        viewer = new GraphViewer();
        graphView = new JScrollPane(viewer);
        graphView.setHorizontalScrollBarPolicy(JScrollPane.
                                               HORIZONTAL_SCROLLBAR_ALWAYS);
        graphView.setVerticalScrollBarPolicy(JScrollPane.
                                             VERTICAL_SCROLLBAR_ALWAYS);
        graphView.getViewport().setBackground(Color.white);
        graphView.setBorder(BorderFactory.createEtchedBorder());
        graphView.setToolTipText("Graph Output Display Window");
        repaint();
      public JScrollPane getGraphView() {
        return this.graphView;
      public Dimension getSize() {
        graphView.setPreferredSize(new Dimension(520, 440));
        return graphView.getPreferredSize();
      class GraphViewer
          extends JPanel {
        public void paintComponent(Graphics g) {
          super.paintComponent(g);
          int nodeWidth = 20;
          int nodeHeight = 20;
          if (graphappz.Main.graph != null) {
            Graph graph = graphappz.Main.graph;
            Iterator iter = graph.edgeIter();
            while (iter.hasNext()) {
              Edge e = (Edge) iter.next();
              Vertex v_0 = e.getv0();
              Vertex v_1 = e.getv1();
              if ( ( (v_0.getLayoutPosition() != null) ||
                    (v_1.getLayoutPosition() != null))) {
                Point2D.Double pos_0 = v_0.getLayoutPosition();
                Point2D.Double pos_1 = v_1.getLayoutPosition();
                // draw the edge
                g.setColor(Color.red);
                g.drawLine( (int) pos_0.x + (nodeWidth / 2),
                           (int) pos_0.y + (nodeHeight / 2),
                           (int) pos_1.x + (nodeWidth / 2),
                           (int) pos_1.y + (nodeHeight / 2));
                // draw the first node
                g.setColor(Color.blue);
                g.drawOval( (int) pos_0.x, (int) pos_0.y, nodeWidth, nodeHeight);
                g.fillOval( (int) pos_0.x, (int) pos_0.y, nodeWidth, nodeHeight);
                // draw the second node
                g.setColor(Color.blue);
                g.drawOval( (int) pos_1.x, (int) pos_1.y, nodeWidth, nodeHeight);
                g.fillOval( (int) pos_1.x, (int) pos_1.y, nodeWidth, nodeHeight);
                // draw the edge
                g.setColor(Color.black);
                g.drawString(v_0.getReference() + "", (int) pos_0.x + 5,
                             (int) pos_0.y + 14);
          else {
            graphappz.util.Debug.debugText.append("\n graph is null, can't draw it");
            //TODO: show new Alert_Dialog
        public GraphViewer() {
          this.setBackground(Color.white);
          this.addMouseListener(new MouseListener() {
            public void mouseClicked(MouseEvent e) {}
            public void mousePressed(MouseEvent e) {}
            public void mouseReleased(MouseEvent e) {}
            public void mouseEntered(MouseEvent e) {}
            public void mouseExited(MouseEvent e) {}
    }

    Scrollbars will appear when the preferred size of the panel is greater than the preferred size of the scrollpane.
    When you add components (JButton, JTextField...) to a panel then the preferred size can be calculated by the layout manager.
    When you draw on a panel the layout manager has no idea what the size of you panel is so you need to set the preferrred size yourself:
    panel.setPreferredSize(...);

  • Scrolling - I want my site to be central on screen, so I have pined it, yet if the screen using to view is smaller than mine, it wont scroll? even though it shows scroll bars.

    I have designed a wide site so the background fills the screen on all size monitors. However because I have pined it to the top and central it wont scroll on smaller screens. How do I keep the site central when first opened and allow it to scroll vertically?
    Link to live site below.
    Thanks
    Chris
    home

    Hi Chris
    That is a default behavior where the page content is wider but the resolution or browser window is smaller, then browser will add auto scroll.
    I have checked the site with a lower resolution and I can scroll down the page vertically and horizontally , is that you see the issue with any specific resolution or browser ?
    Thanks,
    Sanjit

  • JScrollPane auto scrolling.

    Hi Friends,
    Basically I want text in the JTextArea added to the JScrollPane to scroll automatically.
    I have a JFrame to which I have added a horizontal JSplitPane. The Left side of the SplitPane consists of a JPanel with different components and the Right side consists of a JPanel with a JScrollPane containing the JTextArea which displays some Help/News etc.
    I want this text to keep on scrolling continuously, while the user does his work on the Left side, till me application exits.
    Please help me out on this.
    Regards,
    Ravi

    try this:
    JScrollPane scrollPane = new JScrollPane(textArea);
    textArea.setPreferredSize(new Dimension(100,300)):
    scrollpane.setPreferredSize(new Dimension(82,250));
    I am not sure whether it will work or not in your case.but it does work in my application.Hope it works!

  • My phone is in some mode where it will say everything i am trying to open and i have to double tap on it to open and wont scroll. whats wrong?

    my phone is in some mode where it will say everything i am trying to open and i have to double tap on it to open and wont scroll. whats wrong?

    You are in VoiceOver mode, you need to go into your settings>general>accessibility and turn off VoiceOver. 

  • How do I select a cell in a multicolum​n list box and use scroll horizontal on th

    From an event structure, how do I select a cell in a multicolumn list box and use scroll horizontal on the front panel at the same time.  I can select a cell from the multicolumn in an event structure, but I cannot move the scroll bar on the front panel when the program is running.
    Solved!
    Go to Solution.

    I'm assuming you're referring to the scrollbar in the multicolumn listbox. What is your code doing when you select a cell? Can you please post your code so we can see the behavior you're describing? It's possible that you're blocking the event structure, as in performing some long operation in the event that's handling the cell selection. In this case the event structure has to wait until the event completes before being able to respond to the next event. You can configure the event to not lock the front panel while waiting for the event to complete.

  • How can I prevent Magic Mouse from scrolling horizontally when I don't want it to?

    I recently purchased a Magic Mouse to go with OS 10.6 Snow Leopard. It's a great mouse but it causes 2 problems:
    If I leave it on "Scroll with interia" in System Preferences/Mouse, it scrolls horizontally when I don't want it to.  Since I mostly work in Word documents, I often lose my place in the document this way. On the other hand, checking "Scroll without inertia" makes vertical scrolling, which I do all the time, a lot harder.
    The mouse seems to cause what I think of as "fractures" in Word documents--words and parts of sentences will disappear or get crunched together , then reappear when I select the place where they vanished.  They also reappear if I scroll vertically to get the problem area off the screen and then return to it. This wastes a lot of time at best; at worst, I'm afraid I'll lose work.  The problem occurred once in a while with a Logitech bluetooth mouse I was using, but not as bad and not all the time.
    I love the mouse's ergonomics and would like to keep it, but if I can't solve this problem, I'll have to return it.  Would be very, very grateful for any tips!  Thanks.

    Always nervous about recommending sites I have no personal experience of.  On the plus side it doesn't relate to any of the bad sites I am familiar with and it appears to be the developer's site ... but there is no contact point for you to ask questions.  You said in your initial post it was to go with Snow Leopard but this version says it is meant for 10.7 and above.   Did you notice that?   I also notice several other references to Word and mouse and one person found the solution lay in the updating of word 2011 to its highest level.   I can offer no more.

  • I am unable to get my Logitech T620 touch mouse to scroll horizontally in Photoshop CS6

    I am unable to get my T620 touch mouse to scroll horizontally in Photoshop CS6. Any suggestions on how to enable this? The bar at the bottom of the document moves left/right as I scroll, but the screen doesn't.
    I am using a T620 touch mouse on Windows 7 64 bit with the latest version of setpoint. I have checked the box in the mouses settings to allow sidescrolling with a swipe of 1 finger. I am aware you can hold control and swipe up/down to get a left right scroll.
    Thanks in advance

    This site may help.
    How can I establish horizontal scroll with T620 To... - Logitech Forums
    If this does not solve the problem, you may want to address your inquiry to the techs at that site.

  • Cant scroll horizontally with mouse wheel in FF

    I cant scroll horizontally in FF unter XP+SP3 by pressing the mouse wheel sideways. This is the same in FF 3.6 and 4.0 beta, while in IE 6.0 and in other MS programs (Explorer, Word, ...) it works fine. I am having this problem with 2 different mice: Fujitsu 400NB and easytouch ET-9600. I cant find newer drivers for them than what I have installed from the CDs. Here some settings from my FF: mousewheel.horizscroll.withnokey.action;0 mousewheel.horizscroll.withnokey.numlines;1 mousewheel.horizscroll.withnokey.sysnumlines;true. Some time ago I played around with them but that didn't help. What else can I do to get FF scrolling horizontally?

    This should get you there
    http://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/
    1. Load the mousewheel min script via CDN (jquery-mousewheel - cdnjs.com - the missing cdn for javascript and css)  into the Scripts Panel;
    2. Add the provided snippet into your Stage > compositionReady event handler.
    hth
    Darrell

  • Mighty Mouse will not scroll horizontally uder 10.3.9 why???

    Hi all
    I was trying out my Mighty Mouse under 10.3.9 and it's not scrolling horizontally and on Apple support sight it said that it should scroll horizontally and vertically but it just doesn't scroll horizontally why is this? I have tried it on 10.4.10 and no problem here so I know that the scroll ball works and not broken. Is it a software/hardware "glitch" under 10.3.9 or a typo in part of Apple and if not how can I make it scroll horizontally under 10.3.9????
    Thanks!!!!!
    PS: Here's what Apple says in they're "Support" section:
    +*If you use Mighty Mouse on a computer with Mac OS X 10.3.9 or earlier, the mouse offers the following functionality:*+
    +*Primary and secondary button functions are assigned to left and right buttons respectively*+
    +*Vertical and horizontal scrolling is enabled (scrolling can't be disabled)*+
    +*Can activate Exposé from the Exposé pane in System Preferences*+

    I believe the booklet that came with the mouse explains what features work with each version of Mac OS X (I can't remember the page - I don't have the booklet to hand at the moment); I would expect the scroll ball to work with 10.3.9...

  • Scroller wont scroll

    This might call for me to post the code, if so let me know and I will,I have an applet that I am trying to use a scroll panel and move the scroll bar when information is added to a JEditorPane contained in the scrollpane, the text shows but the scroll panel wont scroll to the position that I want it to when I run it in the applet but it will scroll when I run it in appletviewer? Any tricks to this or am I being to vague? Thanks in advance. Joe

    If I understand you correctly you want to see the last added text in the pane. If this is the case use the JTextComponent class's setCaretPosition() method to move the caret to a specific location. In your case retrieve the length of text in the pane and use that as a parameter to the method.

  • Bug: scrolling horizontally in finder

    Just upgraded to lion and I want to know if anyone else is experiencing stuttering in finder when scrolling horizontally in pane view. It seems to occur more when I'm scrolling towards the right for some reason. Basically the window starts stuttering and the scrolling just doesn't respond correctly or is very slow. It doesnt really make a difference what folder im looking at, and there is nothing running in the background that would cause anything to slow down.
    I'm using a 2011 15" MBP (2.2ghz, 8gb ram).

    I spoke with apple support over the phone for about an hour.
    Eventually we came to the conclusion that this is part of the OS
    It's hard to make a perfect sideways scroll motion, so it gets confused and quickly switches back and forth between vertical and horizontal scrolling.
    Apparently Apple built in a quick swipe/flick motion that should work if done correctly.
    (flick instead of scrolling slowly)
    I can sometimes get it to work ok, but it takes a bit more precision than I'd like.
    It seems to be easier to get a perfect sideways scroll by running 2 fingers along the top edge of the track pad.
    The rep. said they are going to see if it makes sense to add another multi touch gesture to get the desired effect, or if they can just make the finder window work more like safari does. It seems to switch between horizontal and vertical scrolling without any hiccup.

  • Scrolling horizontally in Code view with tilt-wheel mouse.

    I'm having an issue with scrolling horizontally via my mouse's tilt-wheel, side-scrolling feature.  I'm using Dreamweaver CS6 in WIndows 7, but perhaps the bug may apply to CC as well.
    When I scroll sideways, the scrollbar moves, but it loses all of it's styling (gradient effect and draggable icon) but the view content does NOT move at all.  After side-scrolling, if I click anywhere in the Code view, the styling resets and the content tries to reconcile with the scrollbar's location, and the view breaks, like this:
    Scrolling vertically past these lines and back resolves the text breakage.  But, horizontal scrolling is still a pain unless I make the effort to drag the scrollbar with my cursor.
    I've considered it being a driver issue, so I reinstalled them and restarted.  I've installed legacy versions and restarted.  No dice.
    Has anyone else experienced this?  Why is tilt-wheel side-scrolling different than clicking the right arrow button?  Any help would be appreciated!

    Thanks Jon.
    But, I'd rather not word-wrap.  I see plenty of how-to's for word-wrapping, so I'm not sure if I'm really alone in wanting to visually maintain longer lines, or whether hardly anyone else has tilt-wheel issues, or that they don't find it worth posting for help about. 
    Hm.  I'll keep looking for a solution for a while longer.

  • Magic mouse will not scroll horizontally

    Magic mouse will not scroll horizontally

    We need far more information.
    Has it previously scrolled horizontally?   Is the fault restricted to certain browsers or program facilities?   What machine are you using it on?    Has this problem appeared following an OS upgrade.

  • Why is it possible to scroll horizontal when there is none?

    Hi there people,
    I hope some of you can help me out with this little problem. Put lots of effort in my new portfolio but there is one irritating thing I can't get on with. The option to scroll horizontale is constantly enabled while there is nothing on the side; just blank! Maybe this is because I put images in the header and footer in the master. I want these images fixed in the middle and to be repeated in the browser. How can I do this? Is this a bug or just inexperience?
    Here is the link of the trial:
    http://nkrouwel.businesscatalyst.com
    Please help me out here!
    Thanx

    Hi,
    It sounds like what you're looking for is to have the images as background fills for a rectangle. If you set the rectangle to have no background fill or stroke then set these images as the background for them you can tile (horizontally, vertically, or both) the image and you can set the rectangle to be 100% width. That way the rectangle will always be the same width as the browser and the image will be repeated, or set in the middle of the page and you don't need to tile the image.
    Anytime you have an object outside of the browser area in Muse the page will scroll horizontally, so the easiest way to achieve any effect that you want to be 100% width will be to use rectangles, text frames, and any other object that supports 100% width.
    Hope that helps!
    Dana

Maybe you are looking for