Scrollbar problem, HELP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

my scrollbars do not work, anybody know why? here is part of my code:
JEditorPane editorPane = createEditorPane();
JScrollPane editorScrollPane = new JScrollPane(editorPane);
editorScrollPane.setVerticalScrollBarPolicy(
        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setHorizontalScrollBarPolicy(
        JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
editorScrollPane.setPreferredSize(new Dimension(800, 650));
editorScrollPane.setMinimumSize(new Dimension(10, 10));

Hi again, I finally realized from your code that my program will not work since i can only load a url to be able to have a scroll bar. So I modified my code to the following. Can you please help me get scrollbars on this instead? thanks so much
        public Jtest () throws Exception {
                rect_height = 15;
                rect_width = 27;
                addWindowListener(new WindowAdapter() {
                                          public void windowClosing(
                                                  WindowEvent ev) {
                                                  dispose();
                                                  System.exit(0);
                setLayout(new BorderLayout());
                add("Center",pan);
                setBounds(1, 1, 700, 700);
                setVisible(true);
        public class DPanel extends Panel implements MouseListener {
                public DPanel() {
                        addMouseListener(this);
        public static void main (String[] args) throws Exception {
                Frame frame = new Jtest();

Similar Messages

  • Scrollbar problem - any ideas?

    I know another scrollbar problem...ive read the posts but cant solve it. Anyone got any ideas?
    got a program called Map which draws a map (using paint()) of a web site. I can get it to work but often there are so many links they go off the page.I need a scrollbar.
    In main i set up a frame: JFrame frame=new JFrame("M");
    Then set up scrollbar: JScrollPane cf = new JScrollPane();
    cf.setHorizontalScrollBarPolicy (JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );
    cf.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
    Then add scrollbar to frame: frame.getContentPane().add(cf);
    Then add Map() - my main prog: cf.add(new Map());
    (Map constructor calls repaint() - paint method draws to screen. main program extends JComponent)
    All i get is a blank (grey frame) with a scrollbar :) ...doesnt show Map - paint
    I can ignore scrollbar and use a container instead -
    Container c=frame.getContentPane()
    then set its layout : c.setLayout(new BorderLayout());
    and add Map() to it : add(new Mapper(),BorderLayout.CENTER);
    It works fine - but i need a scrollbar...
    Thanks for your time&help

    Hers the code for my main Mapper program (which is loaded first) and the Scan program(below).I know the structures all over the place+thats the problem. I would like a scrollbar. Also everytime i scan a new window opens, it would be good if only 1 ever opened.Ive been fiddling for days and am lost.Can anyone sort it out? I think the codes ok, just needs restructuring...
    The main Mapper program :
    package project.e;
    import javax.swing.*;import java.awt.*;import java.awt.geom.*;import java.awt.event.*;
    import java.io.*;import java.net.*;import java.lang.Math.*;import java.util.*;
    public class Mapper extends JComponent{
    static int w = 1000;
    static int h = 1000;
    static String [] Lnks = new String [5000]; //Lnks
    public Mapper()
    { repaint();}
    public void paint(Graphics g){
    Graphics2D g2D=(Graphics2D)g;
    Toolkit tk = Toolkit.getDefaultToolkit();
    Image img = tk.getImage("c:/windows/desktop/project/e/wirecube.gif"); //setup images
    Image rimg = tk.getImage("c:/windows/desktop/project/e/bwirecube.gif");
    int ww=(w/2);int hh=(h/2);
    g2D.setFont(new Font("Times New Roman", Font.PLAIN,12));
    g2D.setPaint(Color.cyan);
    g2D.drawString("Web Page Scanned : ",10,50); g2D.drawString(Scan.url,120,50);
    g2D.drawString("Total Links Found : ",10,100); g2D.drawString(String.valueOf(Scan.x),120,100);
    g2D.drawImage(rimg,ww-88,50,this); g2D.setFont(new Font("Times New Roman", Font.PLAIN,12));
    g2D.setPaint(Color.green);
    g2D.drawString(Scan.url,ww-88,50);
    int a=w/5;
    int up=0;
    int lx=0;
    g2D.translate(ww,hh);
    g2D.translate((-ww-a)+10,-300);
    for (int i=0;i<(Scan.x);i++){ //loop - drawing all (5 per line)
    if (lx==5){g2D.translate((-ww-ww),100);lx=0;} //every 5 times
    g2D.translate(a,0);
    g2D.drawImage(img,0,0,this); //img
    g2D.setFont(new Font("Times New Roman", Font.PLAIN,12));
    g2D.setPaint(Color.green);
    g2D.drawString(Lnks[up],ww-ww,hh-hh-10); //URL
    if (Scan.tl==true){g2D.drawString(Scan.IorE[up],ww-ww,hh-hh-25);}lx=lx+1;up=up+1;}}
    public static void main(final String [] args){          
    System.arraycopy(Scan.Links,0,Lnks,0,Scan.x);
    JFrame frame=new JFrame("Mapper"); //frame setup
    JMenu menu = new JMenu("Menu");
    JMenuItem scan = new JMenuItem("Scan");
    scan.setMnemonic(KeyEvent.VK_S);
    scan.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK));
    scan.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){Scan.main(args);}});
    //call Scan
    JMenuItem downloadLink = new JMenuItem("download-Link");
    downloadLink.setMnemonic(KeyEvent.VK_L);
    downloadLink.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L,Event.CTRL_MASK));
    downloadLink.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){GetLink.main(args);}});
    JMenuItem downloadImage = new JMenuItem("download-Image");
    downloadImage.setMnemonic(KeyEvent.VK_I);
    downloadImage.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I,Event.CTRL_MASK));
    downloadImage.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){GetImage.main(args);}});
    JMenuItem Quit = new JMenuItem("Quit");
    Quit.setMnemonic(KeyEvent.VK_Q);
    Quit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,Event.CTRL_MASK));
    Quit.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){System.exit(0);}});
    JMenuBar menuBar = new JMenuBar();
    menu.add(scan);
    menu.add(downloadLink);
    menu.add(downloadImage);
    menu.add(Quit);
    menuBar.add(menu);
    frame.setJMenuBar(menuBar);
    Container c = frame.getContentPane();
    c.setLayout(new BorderLayout());
    c.add(new Mapper());
    c.setBackground(new Color(0,0,0));
    frame.setJMenuBar(menuBar);
    frame.setBounds(0,0,w,h);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);}}
    Scan :
    package project.e;
    import java.awt.*;import java.awt.geom.*;import java.awt.event.*;import javax.swing.*;import javax.swing.text.*;import javax.swing.text.html.*;import java.io.*;import java.net.*;
    public class Scan{
    static String [] Links = new String[5000]; //array of links
    static String [] IorE = new String[5000]; //array - Internal or External
    static int x = 0; //length
    static String url = new String(); //url
    static String type = new String(); //link/image
    static boolean tl;
    static String l = new String("links");
    static String i = new String("images");
    public static void main(String [] args){
    Links = new String[5000]; //need to repeat ini. for rescanning
    IorE = new String[5000];
    x = 0;
    url = new String();
    type = new String();
    EditorKit kit = new HTMLEditorKit();
    Document doc = kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective",Boolean.TRUE);
    try{
    type = JOptionPane.showInputDialog(null,"Please enter file type to scan for - links / images ");
    url = JOptionPane.showInputDialog(null,"Please enter URL"); //get url (var.) to map - dialog box
    Reader rd = getReader(url); // Create a reader on the HTML content
    kit.read(rd, doc, 0); // Parse the HTML.
    ElementIterator it = new ElementIterator(doc);
    javax.swing.text.Element elem;
    while ((elem = it.next()) != null){  
    if (type.equals(l))
    tl =true;
    //int bol = url.indexOf(".com");
    SimpleAttributeSet s = (SimpleAttributeSet)
    elem.getAttributes().getAttribute(HTML.Tag.A);
    if (s != null)
    Links[x]=String.valueOf((s.getAttribute(HTML.Attribute.HREF)));
    String tmp = Links[x].substring(0,1);
    if (! tmp.equals("h")){
    if (! tmp.equals("/"))
    {Links[x]="/"+Links[x];}} //if string doesnt start with h or /                                    //then add a / to start
    if (Links[x].startsWith("/")){System.out.println("Internal Link");IorE[x]="Internal Link";} //if starts with / then internal
    else{
    if (Links[x].startsWith(url)){System.out.println("Internal Link");IorE[x]="Internal Link";} //else if starts with url then internal
    else{
    String tmp3 = url.substring(11); //else if contains url - (http://www.) eg. 123.ibm.com then internal
    int b=0;
    b=Links[x].indexOf(tmp3);
    if (b>0){System.out.println("Internal Link");IorE[x]=("Internal Link");}
    else{System.out.println("External Link");IorE[x]=("External Link");}}} //else must be external (doesnt start with / or url or contain middle bit of url)
    System.out.print("Link : ");
    System.out.print(x);
    System.out.println();
    System.out.println(Links[x]);
    System.out.println();
    x=x+1;
    if (type.equals(i))
    tl=false;
    if ( elem.getName().equals( HTML.Tag.IMG.toString() ) ){
    Links[x] = String.valueOf(elem.getAttributes().getAttribute( HTML.Attribute.SRC ));
    System.out.print("Image : ");
    System.out.print(x);
    System.out.println();
    System.out.println(Links[x]);
    System.out.println();
    x=x+1;}
    Mapper.main(args);
    }catch(Exception e){e.printStackTrace();}
    static Reader getReader(String u) throws IOException{
    if (u.startsWith("http:")){
    // Retrieve from Internet
    URLConnection con = new URL(u).openConnection();
    return new InputStreamReader(con.getInputStream());}else{
    // Retrieve from file.
    return new FileReader(u);
    Also got 2 extra - GetImage & GetLinks...they just go away and do there own stuff...no painting required so cool.The probelms is between Mapper+Scan...
    Thanks for your time&help
    Oly

  • My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    My daughter has just bought me an iPad 2 from Dubai and set it all up for me but unfortunately the iMessage function doesn't seem to work. We keep getting messages,when trying to activate it, that there is a network connection problem - help!

    Thank you both for your responses but my daughter was reassured by the salesman in the iStyle store (official Apple store in the UAE) that iMessages would work but conceded that FaceTime wouldn't. My iTunes account is registered in the uk and my daughter's iPhone has iMessages even though she bought it (and uses it) in Dubai. Can anyone else throw any light on this?

  • I couldn't log into my apple account on my iPad, then i couldn't unlock it resulting in it being disabled, however it's the same as my iPhones password, I then called apple, i was hung up on twice and they said it will cost £70 to fix THEIR problem, help?

    I couldn't log into my apple account on my iPad, then i couldn't unlock it resulting in it being disabled, however it's the same as my iPhones password, I then called apple, i was hung up on twice and they said it will cost £70 to fix THEIR problem, help?

    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup).
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.
    You may have to force iPad/iPod into Recovery Mode
    http://support.apple.com/kb/ht4097

  • IPad syncing problem - HELP!

    iPad sync problem - HELP!  I keep getting this message "...cannot be synced because there is not enough free space to hold all of the items in the iTunes library (additional ...space needed)"  and yet I seem to have plenty of space on the iPad.  This just started today.  I even tried deleting some things to make even more room, but it didn't help.  Any ideas??? 
    I was thinking of restoring, but I've never done it...  should I? 
    thank you!

    Hello florafromnv,
    Welcome to Apple Support Communities.
    The following article addresses how to resolve the issues related to this message:
    iOS: "Not enough free space" alert when trying to sync
    http://support.apple.com/kb/TS1503
    Regards,
    Jeff D.

  • MOVED: KT333 Ultra; fuzzy logic, 1.6xp overclocking problem help !!!!!

    This topic has been moved to Overclockers & Modding Corner.
    KT333 Ultra; fuzzy logic, 1.6xp overclocking problem help !!!!!

    Not that I am an expert o/c but here are some thoughts on the matter.
    My comments are based on my experiences of the KT3 Ultra2 which is basically the same as the Ultra version.
    This mobo does not have the ability to lock the PCI/AGP bus freely from the FSB. However, it does have dividers. At 133 a 1/4 divider kicks in. Above 152FSB the 1/5 divider works, so that at 166 the PCI & AGP buses will be back in sync. If you are o/c your cpu, don't go from 133 to 145, etc since you will be running the PCI/AGP buses further out of whack. Just go to either the mid 150's or to 166 in one jump. The other problem / issue relates to your cpu. From what you say you have one of the old Palominos which are not great o/c's. I would personally o/c your cpu from the BIOS rather than 'Fluffy Logic' which I would tend to stay away from. 
    With a 166FSB cpu a very stable o/c would be 175-177 beyond 180 gets decidedly tricky.
    Hope this helps

  • Itunes keeps closing as soon as i open it and states 'windows has detected a problem' HELP!!!!

    Help!! Itunes keeps closing straight away and message states 'windows has detected a problem' HELP ASAP PLEASE!!!!

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    If you've already tried a complete uninstall and reinstall try opening iTunes in safe mode (hold down CTRL+SHIFT as you start iTunes) then going to Edit > Preferences > Store and turning off Show iTunes in the Cloud purchases. You may find iTunes will now start normally.
    tt2

  • I have installed photoshop elements 12. when I try use the editing features it said that i must login to Adobe to register the product. but each time i try to it said there is a problem. help the problem stated that the internet is not connected, but that

    i have installed photoshop elements 12.
    when I try use the editing features it said that i must login to Adobe to register the product.
    but each time i try to it said there is a problem.
    help
    the problem stated that the internet is not connected, but that is not the case.

    I had the same issue and I'm running Windows 7.  Tried working with technical support for several hours but they were no help.  They just had me doing the same things over and over, offering no real answers.  I finally got fed up and have decided to return my product for a full refund.

  • I can't install the itunes to my windows 7 X86 APPCRASH problem, help me guys

    i can't install the itunes to my windows 7 X86 APPCRASH problem, help me guys??  i don't know what to do..

    Why are you unable to install the iPod Updater? Are you getting an error message? Please be specific.
    Cheers!
    -Bryan

  • Camera (focus) problem - help?

    Duplicate post, please see: Camera (focus) problem - help?
    Message was edited by: Admin Moderator

    Warranty is valid only in country of original purchase. You have to return
    the iPhone to the US for evaluation. Either you return it personally or send
    it to a friend/relative/co-worker in the US to take into Apple. Apple will not
    accept international shipments for evaluation nor will Apple ship out of the
    country after repair/replacement.
    Have you tried the standard trouble shooting steps: restart, restore, restore
    as new iPhone?

  • After update iPhone4 to iOS6, its stuck, showing only USB to iTunes on the screen. What to do, how to solve problem, help

    after update iPhone4 to iOS6, its stuck, showing only USB to iTunes on the screen. What to do, how to solve problem, help 

    Connect your phone to iTunes on your computer like the diagram has indicated and restore the phone

  • Tween scrollbar error help...

    Hi all,
    I am having problems with a scrollbar tween on my site. I have tested the site (jessicaclucas.com) on many browsers, and it tends to work fine. But, on a Firefox browser, I think with a new version of flash player, and also when I run the Debug on Flash, I get this occasional error:
    #1009: Cannot access a property or method of a null object reference.
        at gs::TweenMax()
        at gs::TweenMax$/to()
        at index_fla::MainTimeline/tweenFinished()
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at gs::TweenLite/complete()
        at gs::TweenMax/complete()
        at gs::TweenMax/render()
        at gs::TweenLite$/updateAll()
    This tends to happen if the user clicks on the scrollbar button, begins moving the scroller, and then, without clicking back on the scrollbar button to stop it, the user presses on a button on the left navigation.
    I think I understand what the error is telling me, that it can't complete a function for things that are not yet on the stage. But I am not sure how to fix the code regarding the Tween to get around this.
    Would anyone be willing to look over my files if I sent them?
    Here is the Tween code I am using:
    //Import TweenMax and the plugin for the blur filter
    import gs.TweenMax;
    import gs.plugins.BlurFilterPlugin;
    //Tween the content to the new location.
    //Call the function ResumetweenFinished() when the tween is complete.
    TweenMax.to(myResumecontent, 0.3, {y: targetY, blurFilter:{blurX:22, blurY:22}, onComplete: ResumetweenFinished});
    //This function is called when the tween is finished
    function ResumetweenFinished():void {
    //Tween the content back to “normal” (= remove blur)
    TweenMax.to(myResumecontent, 0.3, {blurFilter:{blurX:0, blurY:0}});
    Thanks for your help!

    have you got any software that mite be blocking the atempt to install the ipod stuff?? if not go to my computer right click on the cd and then click explore then copy all of the stuff from the cd and paste them in a folder outside of the cd and try opening it again (i dont no if it will work but it worked for a game i had not that long ago so its worth a try)

  • JTree scrollbar problem - can't scroll back to top when some nodes hidden

    I have a problem which I cannot resolve: I have a JTree which has had 88 rows added to it, and which then has 15 or so rows set to be not visible; when I then scroll to the bottom of the pane I am unable to scroll all the way back to the top using either the scroll button at the top of the bar or the mouse scroll wheel although I can drag the knob to get to the top; using the button or wheel, the scrolling stops somewhat short of the top; via testing I've found that the AdjustmentEvent is not fired when it reaches that point. Anyone seen this before and/or know a way around it?
    Thanks in advance,
    Mike

    MikeAuerbach267 wrote:
    It turns out that my problem was due to the fact that I am using my own TreeCellRenderer which makes invisible some nodes via user option but doesn't reload the tree; hence the confusion as to the scrollbar size. I now correctly reload after user option has changed rather than render nodes invisible and all is fine. Which reinforces Andrew's view in reply #1 that a 'vague waving about of hands' does not allow the forum members to help.

  • ScriptUI edittext scrollbar problem with Bridge CC Mac

    Hello,
    With Bridge CC for Mac, in the UI, the scrollbar which come with edittext and multiline option, is not active.
    The scrollbar on the right appears by typing text or ENTER, but not by scripting.
    Any idea? Thanks
    #target bridge
    var textgen = new Array();
    for (var r = 0; r < 15; r++) {
        textgen[r] = ("line "+r);
    var generatedtext = (textgen.join('\n')); 
    var win2 = new Window("dialog", undefined, [0,0,200,200], ); // UI
    with(win2){    
        win2.eText = add( "edittext", [5,45,140,175], generatedtext, {multiline: true, scrolling: true} ); // problem here with Bridge CC Mac
        win2.retour = add( "button", [150,5,195,32], "Close" );
    win2.retour.onClick = function() {win2.close();};
    win2.center();
    win2.show();

    Welcome to the wonderful world of bridge UI unsolved bugs!
    On Mac and PC bridge, CS6 or CC
    Sign the petition if we want to make some pressure on in here:
    http://gsfn.us/t/34ccy
    and here:
    http://gsfn.us/t/46vwa
    It time to say it:
    If (Bridge_Team.exists) {
         alert("Help on this old unsolved bug!")
    } else {
         alert("Cloud CC deserves our trust?");

  • TextField set to HTML, Scrollbar problem

    Hi,
    I have a chat box called 'chatbox' which needs to display
    lines in different colors. I've set 'render as HTML' and called the
    var property 'chat_html'. It displays things fine when I add lines
    with, for example, 'chat_html += "<font color =
    '#ff0000'>TEXT</font>'.
    The only problem is the vertical scrollbar doesn't update.
    I've noticed I can make it update by using 'chatbox.text += "" each
    time I add a html line, but this seems to set the colors to all one
    color, namely, 'chatbox's default color.
    Any help on this? How do I update the scrollbar without
    losing the different colors?
    Thanks - Gary.

    In the old way of things - what did change?
    Look at the WebAccess on the HTTP view - how long does it say that it
    has been up?
    rpm -qa novell-group What version
    What does the POA report?
    If this has all got squirrely rcgrpwise stop, rcapache2 stop and
    rctomcat5 stop (then restart them again in reverse order)
    T
    On Fri, 02 Sep 2011 19:26:02 GMT, taphillips
    <[email protected]> wrote:
    >
    >We have webaccess agent 8.0.2 running on OES SLES 10 sp3.
    >In the past few days webaccess users cannot send email when compose
    >view is set to html. They will be redirected back to the address bar to
    >input an address even though there is already and address listed. Some
    >will get the message "you must specify a recipient to send to" It will
    >send ok when set to plain text.
    >It happens across all operating ystems and different browsers and
    >versions I have tried so far.
    >I did find and old reference to this problem, but it had to do with an
    >older agent working against a newer post office.
    >This seemed to happen quite suddenly. We have had several power outages
    >in the last week or so but the server has not gone down.
    >Any ideas?
    >Thanks,
    >Tom

Maybe you are looking for

  • Acrobat X - Read this Page Only not working

    Hello, I have Acrobat Pro X, and need to make accessible PDFs from InDesign. Before I upgraded to Acrobat X, I used to have Acrobat read the text to me to help check the reading order. But in Acrobat X, the "Read this page only" selection does not wo

  • Smart view -Offline Dataforms can have Business rules,Cell Text ,Supporting

    Hi Gurus, Does the Offline Data form is having the Business Rules, Cell Text,Supporting Details if the original Dataform having all those.If yes how they can be retrived in Offline Dataform. Thanq

  • New Scenario.

    Hai all MM gurus, The client is procuring Excisable  Bulk raw materials on contract basis from Vendor & also have a contract with transporter also to carry the material. 1.The stock should be updated with receipt weight - weighbridge weight. 2.He wan

  • IPhone4 - Possible Sync/Backup Solution at last...

    Since upgrading to iTunes 10.7 I've been unable to sync/backup my iPhone 4 via either USB or WiFi. I've had  ALL the different messages over the months - "Can't start a session", can't sync, can't backup, etc. I've followed all the advice from the fo

  • BW Cubes transition to BI cubes for IFRS.... ?

    Hello, Client says they currently have reports coming out of standard SAP BW cubes and reports and they would like to transition to SAP BI cubes and reports.  Do you anyone has similar experience like this?  transition in the sense, they want to buil