Scrollbar in a Dialog

Hello,
referred to the Adobe Toolscript PDF I tried to add an scrollbar to my dialog.
I dont clearly understand how this works.
In my snippet the scroll is added to the dialog but I cant manage to add content to it.
Hopefully someone here can help me with that.
// CREATE new Window (GERMAN)...
   var dlg = new Window('dialog', "Radiobutton Test with Scrollbar", [0, 0, 530, 150]);
   // add panel...
   dlg.msgPnl = dlg.add('panel', [5,20,526,105], '');
    dlg.msgPnl.rbBtn1 = dlg.msgPnl.add('radiobutton', [5, 5, 100, 25], "Button1");
    dlg.msgPnl.rbBtn2 = dlg.msgPnl.add('radiobutton', [5, 30, 100, 50], "Button2");
    dlg.msgPnl.rbBtn3 = dlg.msgPnl.add('radiobutton', [5, 55, 100, 75], "Button3");
    dlg.msgPnl.rbBtn4 = dlg.msgPnl.add('radiobutton', [5, 80, 100, 100], "Button4");
    dlg.msgPnl.rbBtn5 = dlg.msgPnl.add('radiobutton', [5, 105, 100, 125], "Button5");
    dlg.msgPnl.rbBtn6 = dlg.msgPnl.add('radiobutton', [5, 130, 100, 150], "Button6");
    dlg.msgPnl.rbBtn7 = dlg.msgPnl.add('radiobutton', [5, 155, 100, 175], "Button7");
    dlg.msgPnl.rbBtn8 = dlg.msgPnl.add('radiobutton', [5, 180, 100, 185], "Button8");
    dlg.msgPnl.rbBtn9 = dlg.msgPnl.add('radiobutton', [5, 190, 100, 210], "Button9");
    dlg.msgPnl.rbBtn10 = dlg.msgPnl.add('radiobutton', [5, 215, 100, 235], "Button10");
    dlg.msgPnl.scrollbar = dlg.msgPnl.add('scrollbar',  [(dlg.msgPnl.bounds.width-20), 0,  (dlg.msgPnl.bounds.width), dlg.msgPnl.bounds.height]);
   // add ok button.
   dlg.okBtn = dlg.add('button', [426, 122, 526, 146], 'OK', {name:'ok'});  
    dlg.msgPnl.scrollbar.stepdelta = 40;
    dlg.msgPnl.scrollbar.minvalue = 0;
    dlg.msgPnl.scrollbar.maxvalue = dlg.msgPnl.bounds.height;
    dlg.msgPnl.scrollbar.scroll = function(scrollTo) {
        var pnl = this.parent;
        pnl.bounds.top = -scrollTo;
        pnl.bounds.bottom = -scrollTo + pnl._height;  
     dlg.msgPnl.scrollbar.onChange = function() {
        var pnl = this.parent;
        pnl.scrollbar.scroll(pnl.scrollbar.value);
   dlg.msgPnl.scrollbar.onChanging = function() {
        dlg.msgPnl.scrollbar.scroll(dlg.msgPnl.scrollbar.value);
   // ONCLICK NO button...
   dlg.okBtn.onClick = function() {                                                                                                                                                                           
            dlg.close(0);
   dlg.center();
   dlg.show();
Thx in advance!

Well, that's not the way I usually simulate scrolling, but let's experiment the canonical approach:
var N_TOT=25,          // total number of buttons
     N_VIEW=5;          // number of visible buttons
var dlg = new Window('dialog', "Scrollbar Test"),
     panel = dlg.add('panel'),
     gRadios = panel.add('group'),
     sb = panel.add('scrollbar'),
     bOK = dlg.add('button', undefined, "OK"),
     rButtons = [];
// UI Design
panel.orientation = 'row';
panel.margins = 0;
gRadios.margins = 15;
gRadios.orientation = 'column';
gRadios.alignChildren = ['left','fill'];
sb.alignment = ['right', 'fill'];
sb.preferredSize = [20,-1];
sb.value = sb.minvalue = 0;
sb.maxvalue = N_TOT>N_VIEW ? N_TOT-N_VIEW : 0;
sb.stepdelta = 20;
sb.enabled = !!sb.maxvalue;
// Create radio buttons
var i;
for( i=0 ; i< N_TOT ; ++i )
     rButtons[i] = gRadios.add('radiobutton', undefined, "Button"+(1+i));
     if( N_VIEW==1+i )
          { // snapshot
          dlg.layout.layout(true);
          panel.height = panel.size[1];
          sb.height = sb.size[1];
          dlg.height = dlg.size[1];
dlg.layout.layout(true);
// Scrolling system
if( sb.enabled )
     sb.offset = panel.size[1]-panel.height;
     panel.size = [panel.size[0], panel.height];
     sb.size = [sb.size[0], sb.height];
     dlg.size = [dlg.size[0], dlg.height];
     sb.onChanging = sb.onChange = function()
          gRadios.bounds.top = -sb.value*sb.offset/sb.maxvalue;
dlg.show();
Does it work?
@+
Marc

Similar Messages

  • How to give Terminal-output a scrollbar?

    Hi!
    If I have a Script like
    do shell script "ps -xa 2>&1"
    set the_output to the result
    display dialog the_output default button {"OK"}
    then is the output often longer than the dialog-box with the output and therefore the output gets cut. How can I add a scrollbar to this dialog box to be able to look at the complete output?

    Hi Niels
    something like the below, you can select a item in the scroll view and then continue to do other things with it, if you wish by adding extra pieces of code.
    do shell script "ps -xa 2>&1"
    get paragraphs of result
    choose from list (result)
    Budgie

  • Scroll Bars Missing In New Item Dialog Box When Accessing Other Site Collection

    I have run into a problem I am hoping someone can quickly inform me of what I am doing wrong. I am creating 2 hyperlinks on a page that will create new items in one of 2 separate lists (1 on each site collection). I tried using the same code in my CEWP for
    each and encountered a funky issue, whenever I access a different site collection with the below code the dialog box says DIALOG for the title and there are no vertical scroll bars. Does anyone know how to tweak the below code (or improve it) to bring back
    the scroll bars for the dialog box?
    <div class="ms-rteThemeFontFace-1" style="text-align: center; text-decoration: underline"><a class="ms-rteFontSize-3" onclick="javascript:NewItem2(event,&quot;Site URL IS Here/_layouts/listform.aspx?PageType=8&amp;ListId={22980de9-0d12-4def-9df7-95de34b1ebe5}&amp;RootFolder=&quot;);javascript:return false;" href="/_layouts/listform.aspx?PageType=8&amp;ListId={22980de9-0d12-4def-9df7-95de34b1ebe5}&amp;RootFolder=" target="_self"><strong>Add New Project Item</strong></a></div>
    I am eternally grateful to anyone that can tell me what I am doing wrong.
    Thank you

    Hi,
    Thanks for posting your issue, Kindly refer below mentioned URLs to fix your issue
    http://sharepointblogbyshri.blogspot.in/2013/10/sharepoint-2010-modal-dialog-scrollbar.html
    http://blogbaris.blogspot.in/2011/02/no-scrollbar-in-sharepoint-dialog.html
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/37385ef6-5773-47b8-a86a-c5317f6983e5/sharepoint-2010-survey-form-new-item-not-showing-scroll-bar-in-yaxis?forum=sharepointcustomizationprevious
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • 1.2.1 to EA2: connection list too short

    Hi,
    clicking on the button located in the main tool bar to chose a db connections provides a list showing all my defined connections is too short depending on the size an solution of the screen. To have the ability to select all of the many defined db connections there should be a vertical slide bar in this list.
    This behavior exists in the actual production version and the new EA1 and EA2 as well.
    Is that important enough going to get fixed in the current version?
    Regards
    Peter M.

    Did you know that you can click on either the little drop black arrow, which drops a list (not scrollable) or you can click just the the left of that. This gives you a small dialog window with a scrollbar. The dialog window is re-sizable (width-wise) and has a scrollbar.
    These list will not use folders in 1.5. You can add an ER if you want that.
    Sue

  • Why My Screen Painter Only can Edit Specific Attributes

    In my Screen Painter, i only can edit the item's specific Attr,like Caption,but I can't edit the uniqueID,Type.....
    The specific Attr has a EditTxt dialog that i can enter my value,but for the items, it seems disapear. I only see the Attr Name and scrollbar,no edit dialog.
    Why?

    Hi Frank,
    I'm not sure wether I have well understand your problem, I will try to answer anyway.
    The UniqueID, Type, Description... attributes are included into the general item characteristics. When you click on an item you can see in the Items tab all the attributes (in the top the general ones and in the bottom the specifics).
    I can modify all the items attributes without problem.
    Are you using a specific item type?
    Which B1/SDK version do you have?
    Regards
    Trinidad.

  • Workflow annoyance: pop up debugger problems

    I recently started using the debug version of Flash Player for OSX and I've found it pretty stressful.  The window that pops up when there is an error is too small to display the useful parts of the message and there is no horizontal scrollbar on this dialog in OSX.  The window also does not remember the size that I resized it to when it repeatedly pops up, as many OSX applications do.
    There doesn't seem to be any way to dismiss the window except by using the mouse.  It would be nice to be able to turn off the popups and just rely on the console to browse error messages.
    I am very glad that this tool exists for my debugging purposes.  Good luck making it more pleasant to use!
    Thanks,
    -Mike

    Note the date and time the problem occurred, then go to Applications/Utilities/Console and copy the log starting at the time of the crash. Paste the log in a reply. Please do not use a screen shot as they can be hard to read. If there are repeated runs of the same messages, please post only one run. Be selective about what you post and don’t  post huge amounts. Make sure there is no personal data visible. Information learned from Linc Davis.

  • Vertical scrollbar does not work in a nested dialog

    In Adobe Illustrator CC 2014 Win 7 and Mac OS X 10.8
    function dropdown2(win_location, win_width, h50, list2) {
        var ww = new Window ("dialog");
        var g = ww.add ("group");
        var panel = g.add("panel", [0, 0, 300, 200]);
        var sbar = g.add ("scrollbar", [0, 0, 20, 200]);
        ww.show();
    var w = new Window ("dialog");
    w.add("button", undefined, "asdads").onClick = function () {
      dropdown2([200, 200], 200, 50, ["asdaf", "asdaf", "asdaf", "asdaf" ]); };
    w.show();

    function dropdown2(win_location, win_width, h50, list2) {
        var ww = new Window ("dialog");
        var g = ww.add ("group");
        var panel = g.add("panel", [0, 0, 300, 200]);
        var sbar = g.add ("scrollbar", [0, 0, 20, 200], list2);
        ww.show();
    dropdown2([200, 200], 200, 50, ["asdaf", "asdaf", "asdaf", "asdaf" ]);
    var w = new Window ("dialog");
    w.add("button", undefined, "asdads").onClick = function () {
      dropdown2([200, 200], 200, 50, ["asdaf", "asdaf", "asdaf", "asdaf" ]); };
    w.show();
    Illustrator CC 2014
    Ctrl+F12
    first scrollbar its ok
    press button
    scrollbar arrows -> gray

  • How can I open the "Pane Properties Dialog Box", without right-clicking on the scrollbar of the pane?

    To open the "Pane Properties Dialog Box" the LabVIEW Help suggest following:
    "Right-click in the scrollbar of a pane and select Properties from the shortcut menu to display this dialog box."
    The Problem is that I would like to switch off the scrollbars, which once done, means I can't right-click on the scrollbar anymore !
    There must be a different way to get to this Menu, too ?!

    Typically, you would hide the scrollbars only when running, and in this case there is no problem. I guess you should keep at least one of the scrollbars visible in edit mode.
    Once both scrollbars are hidden, you can restore them using the "VI properties...windows appearance...customize" dialog.
    LabVIEW Champion . Do more with less code and in less time .

  • Disable menubar and location from popup dialog in new browser window

    How to hide the toolbar, menubar, location and status for the popup window (not inline, but new browser window style) using ADF 11g?
    Just like HTML javascript:
    window.open ('page.jsp', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')In ADF 11g, I have a jspx refered by a taskflow action with "dialog:" prefix, and I call it from a button like this:
    <af:commandToolbarButton text="Add"
    id="ctbAdd"
    action="dialog:create"
    useWindow="true"
    windowEmbedStyle="window"
    windowModalityType="applicationModal"
    windowHeight="400"
    windowWidth="600"
    />How to control the toolbar, menubar, location and status for the popup window?
    Thanks in advanced,
    Samson Fu

    I tried it but not success. My code as below:
        public void handleAddLaunch(LaunchEvent launchEvent) {
            launchEvent.getWindowProperties().put("toolbar", "no");
            launchEvent.getWindowProperties().put("menubar", "no");
            launchEvent.getWindowProperties().put("scrollbars", "no");
            launchEvent.getWindowProperties().put("resizable", "no");
            launchEvent.getWindowProperties().put("location", "no");
            launchEvent.getWindowProperties().put("status", "no");The popup windows contains all the toolbar, menubar, location...
    Is there any example or reference for the keys and values for getWindowProperties()?
    Regards,
    Samson Fu

  • To disable the horizontal scrollbar and to create a next button to navigate

    To disable the horizontal scrollbar and to create a next button to navigate through the records. At present I create a JSF page and drag and drop my table view and then using the Tuning property I have limited the number of records to be shown. But I need to add a button and then code it to display the next few records. Can someone kindly suggest a suitable mechanism to get this accomplished.
    Edited by: 888970 on Oct 2, 2011 10:15 PM

    Hi Erp,
    At present these are the entries that I have in my JSPX page.
    I have a Table, Iterator and a Input List of Values. As per the scenario, I want a few rows to appear on the table for which I wanted to disable the horizontal scroll bar and then once I click on the list of values it must prompt me with the remaining page numbers.
    Earlier there are about 150 records in the table. I want to show them as 15 per page.
    For which I have added the Iterator and a LOV component code in my JSPX page.
    <af:iterator id="i1"
    value="#{bindings.NsEventDetailsView1.collectionModel}"
    var="row"
    binding="#{pageFlowScope.testPageBean.myIterator}"/>
    <af:inputListOfValues label="Label 1"
    popupTitle="Search and Result Dialog" id="ilov1"/>
    Then I created the bean class as per the example.
    Below is the bean class:
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import org.apache.myfaces.trinidad.component.UIXIterator;
    import org.apache.myfaces.trinidad.event.AttributeChangeEvent;
    public class TestPagebean {
    public TestPagebean() {
    public void i1ov1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    private UIXIterator myiter;
    public void setI1(UIXIterator myiter) {
    this.myiter=myiter;
    public UIXIterator getmyiter() {
    this.myiter=myiter;
    public UIXIterator setmyiter() {
    return myiter;
    UIXIterator valueIterator = getmyiter();
    if (!valueChangeEvent.getNewValue().equals(valueChangeEvent.getOldValue())) {
    int newPage =
    Integer.parseInt(valueChangeEvent.getNewValue().toString());
    int pageStart = (newPage) * valueIterator.getRows();
    valueIterator.setFirst(pageStart);
    AdfFacesContext.getCurrentInstance().addPartialTarget(valueIterator);
    But i am getting errors in the bean class.
    1. Block expecting }
    2. public UIXIterator getmyiter() {
    this.myiter=myiter;
    Return Statement missing
    3. Block expecting {
    4. Type or variable 'valueChangeEvent' not found
    5. Method 'getNewValue' not found
    6. Method 'getOldValue' not found
    7. Method 'toString' not found
    Can you suggest a possible solution?

  • Scrollbar not working in a JScrollPane

    In the JDialog there is a JScrollPane. JTextPane is in a the scroll pane. For some reason the scrollbars are not working.
    Any suggestions on this why the scrollbars not working?
    Thanks.

    using the setText() method the text is set to the text pane from some other package. the Dialog displays the text too with the vertical scroll bar that doesn't work.
    public MyDialog(JFrame frame) {
    super(frame);
    initialize();
    private void initialize() {
    this.setResizable(true);
    this.setName("");
    this.setUndecorated(false);
    this.setContentPane(getScrl());
    this.setSize(400, 300);
    this.centerDialog();
    private javax.swing.JScrollPane getScrl() {
    if (scrl == null) {
    scrl = new javax.swing.JScrollPane();
    scrl.setViewportView(getTxt());
    return scrl;
    private javax.swing.JTextPane getTxt() {
    if (txt == null) {
    txt = new javax.swing.JTextPane();
    txt.setBackground(java.awt.SystemColor.info);
    txt.setEditable(false);
    return txt;
    public void setText(String text) {
    if (txt.getEditorKit() == null) {
    txtToolTip.setEditorKit(new StyledEditorKit());
    txt.setContentType("text/html");
    txt.setOpaque(true);
    txt.setText(text);

  • Click on table scrollbar

    Hi
    i've a problem
    i have an event structure with a table
    when i click into a cell a dialog box ask me some values and it works properly.
    When i've several values into table 2 scrollbars are visible and the click on the scrollbars arrows (and on bars) are treated as event and the dialog box appears again.
    How can i separate this two "clicks behaviour" ?
    thanks
    http://www.sd-studio.it - web design agency

    no...the problem isn't how to insert values etc...this works great
    the problem is understanding the reason why when i click on the scrollbar to move left or right the event structure execute the code inside the "mouse up" event.
    http://www.sd-studio.it - web design agency

  • Disappearing Scrollbars

    Hi,
    I have a problem with the JScrollPane.
    When adding some components to a panel inside a JScrollPane whereby most components are invisible at the start and made visible by user actions, the scrollbars disappear when making components visible.
    More precisely, I always resize the whole frame when making a component visible. If the frame is too big to fit on the screen, they first appear, but when making one more component visible, they disappear again.
    Very strange is also, that when I minimize the dialog and then maximize it again, they reappear again. This sounds like a bug for me...
    Any help would be appreciated. BTW, I'm using Java 1.6.0.
    import java.awt.BorderLayout;
    import java.awt.Font;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JToolBar;
    public class ScrollBarTest
         public static void main(String[] args)
              final JFrame frame = new JFrame("ScrollBar Test");
              frame.setLayout(new BorderLayout());
              Font font = new Font(Font.DIALOG, Font.PLAIN, 80);
              JPanel panel = new JPanel(new GridBagLayout());
              GridBagConstraints cons = new GridBagConstraints();
              cons.gridwidth = GridBagConstraints.REMAINDER;
              final List<JLabel> labels = new ArrayList<JLabel>(20);
              for (int i = 0; i < 20; i++)
                   JLabel label = new JLabel("Label " + i);
                   label.setFont(font);
                   labels.add(label);
                   if (i > 0)
                        label.setVisible(false);
                   panel.add(label, cons);
              frame.add(new JScrollPane(panel), BorderLayout.CENTER);
              JToolBar toolbar = new JToolBar();
              JButton button = new JButton("Klick");
              button.addActionListener(new ActionListener()
                   int     firstInvisible     = 1;
                   @Override
                   public void actionPerformed(ActionEvent e)
                        labels.get(firstInvisible).setVisible(true);
                        firstInvisible++;
                        frame.pack();
              toolbar.add(button);
              frame.add(toolbar, BorderLayout.NORTH);
              frame.pack();
              frame.setVisible(true);
    }

    If the frame is too big to fit on the screen, they first appear, but when making one more component visible, they disappear again.I reset the maximum frame height and it works the way I would expect it to. That is the frame height doesn't change and scrollbars appear.
    frame.pack();
    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    Rectangle bounds = env.getMaximumWindowBounds();
    int height = bounds.height;
    Dimension d = frame.getSize();
    if (d.height > height)
         d.height = height;
         frame.setSize(d);
    }

  • 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

  • Forms 6i window scrollbar focus (flickback)

    i have a requirement to make a tall/high dialog style form that can be displayed on different screen resolutions. A scrollbar needs to be used to enable users of lower resolution screens to scroll from the top of the canvas to the bottom (<b>without key press type navigation</b>). The problem is focus flicks back to the last item that had the cursor in it.
    For example:
    in forms 6i (at least) if you create a content canvas that is larger than is able to be displayed on the screen then assign it to a window that has a vertical and/or horizontal (so you can scroll down the oversized canvas) and can be maxmized. Place a text item at the top and a button at the bottom of the canvas. run the form, focus/cursor goes to text item at the top. maximize the window. use the scrollbar to view the button at the bottom....as soon as the mouse leaves the scrollbar and enters the canvas focus flicks back to that part of the canvas containing the text item which has the cursor in it. This makes it impossible to ever get to that button without a key-next-item or other navigational function.
    i have tried many different settings including using a stacked canvas with its own scrollbar and the same thing happens.
    why on earth is this? is there some way to get around this problem - i want the focus to remain in that part of the canvas that the scrollbar was used to view.
    any assistance would be appreciated.
    regards
    ps: i have not been able to locate any related discussions on this point.

    i have found a workaround, albeit not enormously satisfactory.
    The MDI window scrollbar does not seem to have this flick back problem, just forms defined canvas and form window scroll bars (at least) do. Therefore, so as long as the over-high (or over-wide) form is in a window that is Document Style (meaning it is affected by the MDIs scrollbar - unlike DIALOG style windows) then an overlarge "dialog style" called form can be scrolled down via the MDI scroll bar.
    Edited by: mojo on Dec 3, 2009 11:09 AM

Maybe you are looking for

  • Is there a bug in 10.1.2.0.2?

    We are experiencing a strange issue which we have a service request raised for, but I thought I would open this up to the BPEL community to see if any other customers using the 10.1.2.0.2 BPEL Engine on Windows 2003 with a 10g dehydration store are e

  • Variance in MB5B report

    Hi Fnrds,   When in execute the MB5B Report for one of my finished products , i get some variations . In the Stock type tab i have two options : a) Storage Loc/batch stock b) Valuated Stock . When i execute( Current month ) this repot with option A a

  • Regarding force archiving

    Dear all, When I need to take the backup of latest archive log file, which commad from the below two is better 1. ALTER SYSTEM ARCHIVE LOG CURRENT; 2. ALTER SYSTEM SWITCH LOGFILE; Does both the commands give the same result ? Regards, Charan

  • Using ORACA in Pro*C program

    I'm wanting to use the ORACA structure in my Pro*C program, at the very least, for reporting the SQL statement, source file, and line number if an error is encountered. I've read in numerous places that it is not enabled by default because if impacts

  • Portal 8.1 ??

    Two questions: How can I assign a property to a not logged in user? example, I wany every user of the portal to have a property status set to general_user, where general_user is one of the values set in user property set audience? What are the steps