What's involved in converting JPanel to JScrollPane?

I've build my app and now I realised that I need scrolling functionality on my JPanel. What's involved in converting JPanel to JScrollPane ? Is this what I need to do or is there another way to do it ? I found couple of examples of JScrollPane on sun site but for some reason they don't work...

no none of these works for me ... maybe I have something wrong in my code ?
this is my code:
public ApplicationFrame()
final int DEFAULT_FRAME_WIDTH = 450;
final int DEFAULT_FRAME_HIGHT = 450;
setSize(DEFAULT_FRAME_WIDTH, DEFAULT_FRAME_HIGHT);
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
//Init of top/help panel
          myHelpPanel = new HelpPanel();
          contentPane.add(myHelpPanel, "North");
          //init design area and add it to the container
          myDesignArea = new DesignCanvas(this);
          JScrollPane myScrollPane = new JScrollPane();
          myScrollPane.getViewport().add(myDesignArea);
          //drow canvas border.
          Border compound = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,15,15,15), BorderFactory.createLineBorder(Color.black));
          myScrollPane.setBorder(compound);
          contentPane.add(myScrollPane, BorderLayout.CENTER);
          //init tool bar and add it to the container
          DesignToolBar myTools = new DesignToolBar(myDesignArea, myHelpPanel);
          contentPane.add(myTools, "South");
          //init of menu bar and add it to the container
          JMenuBar menuBar = new JMenuBar();
          setJMenuBar(menuBar);
          //create menu item listener
          MenuListener menuItemListener = new MenuListener();
          //create file menu items and add them to the menu bar
          JMenu fileMenu = new JMenu("File");

Similar Messages

  • What is involved in removing an image from a PDF document and inserting a new one?

    Our form producing process is very typical:
    (1) Start with a TIFF image, create a fresh PDF document.
    (2) By adding items such as links and interactive fields, convert the read-only document into an interactive form.
    Step (2) may take a lot of work, but fortunately when modifications are needed, it is always possible to edit the individual items. No need to redo the whole form from scratch.
    There are some cases, however, in which we have invested a substantial amount of work in Step (2), but we need to modify the underlying image, removing it and replacing it with a new one. We obviously don't want to destroy all the work done in (2).
    I envision the procedure as taking a rug from underneath a person and putting a new one.
    What is involved in doing that? Can that be done at the JavaScript level? Are there commercial packages that can do that? Is the Acrobart SDK required?
    -Ramon

    Document->Replace Pages
    Been in Acrobat since at least version 5.

  • What's involved in putting podcasts on itunes

    What is involved in putting podcasts on itunes? Can anyone point me in the right direction?

    no none of these works for me ... maybe I have something wrong in my code ?
    this is my code:
    public ApplicationFrame()
    final int DEFAULT_FRAME_WIDTH = 450;
    final int DEFAULT_FRAME_HIGHT = 450;
    setSize(DEFAULT_FRAME_WIDTH, DEFAULT_FRAME_HIGHT);
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());
    //Init of top/help panel
              myHelpPanel = new HelpPanel();
              contentPane.add(myHelpPanel, "North");
              //init design area and add it to the container
              myDesignArea = new DesignCanvas(this);
              JScrollPane myScrollPane = new JScrollPane();
              myScrollPane.getViewport().add(myDesignArea);
              //drow canvas border.
              Border compound = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5,15,15,15), BorderFactory.createLineBorder(Color.black));
              myScrollPane.setBorder(compound);
              contentPane.add(myScrollPane, BorderLayout.CENTER);
              //init tool bar and add it to the container
              DesignToolBar myTools = new DesignToolBar(myDesignArea, myHelpPanel);
              contentPane.add(myTools, "South");
              //init of menu bar and add it to the container
              JMenuBar menuBar = new JMenuBar();
              setJMenuBar(menuBar);
              //create menu item listener
              MenuListener menuItemListener = new MenuListener();
              //create file menu items and add them to the menu bar
              JMenu fileMenu = new JMenu("File");

  • What's involved with upgrading to Final Cut Express HD?

    I was just wondering what is involved with upgrading to High Definition. My current computer is a PowerBook G4 and I did not know if this would support the HD. What percentage of users are still using the regular and what percent have upgraded to HD.
    I figured that when I buy a new Mac I would upgrade the HD, but until that point I'd stick with the regular resolution. I would need to buy a new HD video camera too.
    Thanks for any thoughts!

    Hi(Bonjour)!
    FCE HD (3.0 and 3.5) is not only for HD editing, it's the new name for Final Cut Express since version 3.0, and you can edit in HDV or SD with the same product.
    HDV is pretty demanding on computer power, RAM and storage.
    Altough a G4 1,0 GHz meets the minimun requirements to do HDV, pay attention to video card itself. See spec section for FCE HD:
    "Macintosh computer with 500MHz or faster PowerPC G4 or G5 (550MHz for PowerBook G4) or Intel Core Duo
    512MB RAM
    Display with 1024-by-768 (or higher) resolution
    An AGP or PCI Express graphics card compatible with Quartz Extreme or an Intel GMA integrated graphics processor in MacBook or Mac mini
    Mac OS X 10.4.6 or later
    QuickTime 7.0.4 or later
    HDV features require 1GHz or faster processor and 1GB of RAM (2GB recommended)
    500MB disk space required for applications; additional 16GB of additional storage space for Soundtrack and LiveType content (can be installed on separate disks)
    DVD drive for software installation"
    A big monitor is also a good idea (kind of one to one pixel at displaying video:the 23" Apple cinema HD display 1920 X 1200 pixels or greater).
    Think about an external hard drive to store your captured media.
    In the camcorders line-up, it's better to choose a tape recording based one (no hard disk, nor DVD nor media card recorder), because FCE HD allows capture directly from a such camcorder (altough it's possible to download from other sources and convert your material to something that FCE can handles without rendering. A 3 CDD one is better (I own the fabulous FX-1). Many HDV camcorders allows down conversion directly from capturing process: so we can edit in SD format with the same material.
    Currently, HDV can be edited on FCE HD, but you will have to print to tape your edited HDV content to keep it in HDV format. You cannot burn HDV or blue-ray DVD ( aka high definition DVD) from iDVD 6 and watch it on a HD TV set.
    There are some HD DVD burners around the corner ($$$ to buy and blank DVDs are not cheap) but the choice of software is very limited.
    HDV is simply ashtoning to watch on HD tv set and it's the future.
    I think you can count on an instant 200$ rebate if you buy a new mac and FCE HD on apple store:
    http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?mco=37C 4CB71&nclm=Moviedeal
    Good luck.
    Michel Boissonneault

  • What type of adapter/ converter would I purchase from Apple if traveling to France? Does Apple even offer one?

    What type of adapter/ converter would I purchase from Apple if traveling to France? Does Apple even offer one?

    The power supplies used by Apple can be used with any line voltage between 100 and 240 volts so you done need any changes there.
    What you will need is pin adapters because the European socket require different shaped pins. You can get the pins adapters at any hardware store quite inexpensively.
    Read http://www.francetravelplanner.com/details/electric.html

  • My hard drive died last week, and I needed to install a new one.  Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg.  Now I can get the .pdf but can't determine what to do to convert to .jpg.  Does anyone know ?

    My hard drive died last week, and I needed to install a new one.  Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg.  Now I can get the .pdf but can't determine what to do to convert to .jpg.  Does anyone know ?

    Rather than do that, which means starting over from scratch, losing all your edits, organisation and so on, why not simply use iPhoto Library Manager to revert the Library to the older version? Easier, less destructive.
    The instructions on that are here
    If you really want to start over: you can access the Originals folder simply by going to your Pictures Folder and finding the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.

  • Is it possible to add a JPanel to JScrollPane

    i created a JPanel .
    I gave the layout for this panel to be NULL .
    Then i added 16 JLabels in that JPanel(using setbounds)
    when i try to add it to the container i was not able to see last two labels
    So i tried to create a JscrollPane and i add that JPanel to this JScrollPane
    I cant see any difference and the JScrollPane was not working
    The code is:
    JScrollPane scrollPane = new JScrollPane(p);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollPane,BorderLayout.CENTER);
    I dont know
    1) Is it correct to add a JPanel to JScrollPane
    2)Is it compulsory to use a Layout style while using JScrollPane

    i created a JPanel .
    I gave the layout for this panel to be NULL .
    Then i added 16 JLabels in that JPanel(using
    setbounds)
    when i try to add it to the container i was not able
    to see last two labelswhich container ?
    Have you checked that the size of this container is coherent
    with the one of your JPanel ?
    And even before, can this container let the JPanel take the size needed for the
    16 JLabels ?
    So i tried to create a JscrollPane and i add that
    JPanel to this JScrollPane
    I cant see any difference and the JScrollPane was not
    working
    The code is:
    JScrollPane scrollPane = new JScrollPane(p);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollPane,BorderLayout.CENTER);
    I dont know
    1) Is it correct to add a JPanel to JScrollPaneyes
    2)Is it compulsory to use a Layout style while using
    JScrollPaneJScrollPane has it own layout.
    However the component/container you whish to view with the JScrollPane
    can have the Layout you whish.

  • What is better when converting analog video for FCE, Canopus100/110/300/or5

    All,
    What is better when converting analog video for FCE, Canopus100/110/300/or500? I have a new MACPRO with FCE HD and I wanted to convert some of my older video that was recorded on a HI8 Camcorder... Thanks.

    I have the ADVC-100 (older model) and ADVC-110. They are identical except that the ADVC-110 does not come with an AC power adapter. Currently sells for about $220USD. If all you need to do is convert from HI8 tapes, the ADVC100/110 will do the job quite nicely.
    The ADVC300 adds some enhancements for video signal cleanup, but at a higher price. Currently sells for about $450USD. The ADVC500 is overkill for home use.

  • What HDMI to Component converter will work with the current generation Apple TV3?

    What HDMI to Component converter will work with the current generation Apple TV3?

    http://www.hdfury.com/products/hdfuryiii-specs/

  • I'm traveling to Europe for several weeks. What's the best converter to use and how will this effect my computer?

    I"m traveling to Europe for several weeks. What's the best converter and how will this effect my computer over time?

    Right! Our regular power bricks cover the gamut of 100-240 VAC, 50-60 Hz that will take care of everything save, say, a failing portable generator chugging in the tip of the Alps...
    And you can drink the Apple koolaid and purchase the Official $40 Apple Adapter Kit ( http://store.apple.com/us/product/MB974ZM/B?fnode=MTY1NDEwMQ ) that will look chic and color matched to your brick, or do as Kappy says and get a regular equivalent from the nearest Radio Shack

  • How can I pass a file refnum into and out of external c++ code? What type does it convert to in c++?

    I am trying to write external c++ code that will read a file already opened by Labview and therefore assigned a refnum. (Unfortunately, I definately can't use the standard Labview vis.) However I am not sure what c++ type to use in order to manage the refnum.
    All help and thoughts appreciated. Thanks,
    Joanna

    You could do ALL your file handling in C or C++ (MFC CFile for
    example) and pass Microsoft file handles into and out of LabVIEW
    instead of LabVIEW file references into and out of C. This may be an
    easier way to attack the problem.
    You could create a DLL in MSVC that exports a FileOpen function, a
    FileClose function and a FileRead and/or FileWrite Function and then
    call that DLL from place to place as required in your code.
    It would help us if you would explain what kind of data you are trying
    to read or write and what the application is. Is it binary data?
    text files? Do you need some special Win32 file system feature like
    file mapped memory? I guess what I am asking is what is your
    motivation for doing file handling in C or C++?
    Douglas De Clue
    LabVIEW developer
    [email protected]
    "Rolf" wrote in message news:...
    > A LabVIEW file refnum is an internal Magic Cookie to LabVIEW and there is no
    > way to directly extract the actual information assigned to that Magic
    > Cookie.
    > However the CIN Reference Manual describes one function which allows to
    > retrieve a lower level "File" handle and at least on Windows 32 bit and
    > LabVIEW
    > from version 5 up to and including 6.1 this "File" LabVIEW datatype directly
    > maps
    > to the Win32 API "FILE" Handle.
    >
    > The function to use is
    >
    > MgErr FRefNumToFD(LVRefNum refNum, File *fdp);
    >
    > It is declared in extcode.h or one of its dependant headers and exported
    > from "labview.lib"
    > all located in the cintools directory and you can link this lib also to a
    > normal DLL project.
    > However calling this DLL then from any other process than LabVIEW or a
    > LabVIEW
    > executable will not initialize the DLL anymore correctly.
    >
    > Your best option if you need to write in C(++) should be to use the LabVIEW
    > file manager
    > functions described on the External Code Manual (manual/lvexcode.pdf) on
    > this File handle.
    > If you need to use directly some Win32 API functions with it please note
    > that although currently
    > the "File" in the LabVIEW file manager functions matches the FILE in Windows
    > 32 bit API
    > functions this is an undocumented and hence unsupported feature. The next
    > LabVIEW version
    > may actually use a different datatype for its "File" parameter to the
    > LabVIEW file manager calls
    > and your use of assuming File == FILE may simply crash.
    >
    > Also operating on a file refnum in LabVIEW which has been accessed directly
    > with Win API
    > functions may result in strange behaviour such as the file read/write mark
    > not being updated as
    > you would maybe expect it.
    >
    > "Jo" wrote in message
    > news:50650000000800000016520000-1023576873000@exch​ange.ni.com...
    > > How can I pass a file refnum into and out of external c++ code? What
    > > type does it convert to in c++?
    > >
    > > I am trying to write external c++ code that will read a file already
    > > opened by Labview and therefore assigned a refnum. (Unfortunately, I
    > > definately can't use the standard Labview vis.) However I am not sure
    > > what c++ type to use in order to manage the refnum.
    > > All help and thoughts appreciated. Thanks,
    > > Joanna

  • Hello.what is the best converter for iPhone(for converting variety of file formats to mp3)?

    hello.what is the best converter for iPhone(for converting variety of file formats to mp3)?

    the way the total video convert works is really easy you put the song in that you want to convert you tell it to convert into mp3 format and stay the same quality
    Message was edited by: Robert1986nb

  • What database program will convert my Appleworks DB for use on Intel platform?

    What database program will convert my Appleworks DB for use on Intel platform?

    Yes, you just need the appleworks folder from applications.
    However, whether or not this is strictly legal is another question entirely, I'm afraid, unless you are planning to remove appleworks from your computer. You could just buy her her own copy of Appleworks, too.

  • I have been an Adobe customer since 1991 on an old IICi.  Awhile ago I purchased Creative suite 4.  I have Adobe Acrobat 4, ver. 9.5.5.  Are there any updates I can apply?  What is involved in updating if I want to avoid the cloud?  I have a satellite con

    How do I upgrade Acrobat Pro 9.5.5?
    I have been an Adobe customer since 1991 on an old IICi.  A while ago I purchased Creative suite 4.  I have Adobe Acrobat 4, ver. 9.5.5.  Are there any updates I can apply?  What is involved in updating if I want to avoid the cloud?  I have a satellite connection that charges for bandwidth usage.  I have a 27" iMac, using 10.10.3.

    Hi Kenneth ,
    We are sorry but you would not be able to update from Creative Suite 4 .The reason being there are no updates available for Acrobat version 9 .It is quite an older version so you are unfortunately not eligible for any updates or upgrade .
    The best option for you would be to opt for Acrobat DC .
    You could either for Acrobat DC subscription or perpetual version .Here is the link to download the same .
    https://helpx.adobe.com/acrobat/kb/acrobat-dc-downloads.html
    https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html
    You could also opt for Acrobat DC Creative Cloud subscription
      https://creative.adobe.com/products/acrobat
    Regards
    Sukrit Dhingra

  • Can I add a JPanel in JScrollPane?

    Can I add a JPanel in JScrollPane?
    If I added,components in the JPanel can effect the JScrollPane?
    thanks!

    Can I add a JPanel in JScrollPane?yes you can - it is meant for this.
    If I added,components in the JPanel can effect the
    JScrollPane?if you mean affect like focusing and scrolling to a certain place - the answer is yes, you have to look the right functions in each component you insert to the panel.

Maybe you are looking for

  • Loss of visual display wen changing graphics card

    I want to change my graphic card on my dual 500 G4 (currently running on 10.4.11), however I am concerned that once the old card is out I will loose all visual display and therefore will not be abe to follow on-screen instructions when installing the

  • Display not activating

    Last night I grabbed my MBP and ran up to the neighbors to work on some Math Problems. I was telling him how much I loved my Mac and how it hasn't crashed or had any problems (slight lie) since I had it. I opened up the lid and nothing. The system wa

  • Interacting with perl through java.

    I'm trying to do something with Java that I haven't managed to do until now. I'm trying to interact with a perl process giving him input and reading output. I have a perl module that has several functions and the idea is to launch a process in a java

  • Save form as the form data from three fields

    I'm using Adobe Pro 9.0.0 and LC ES. I am trying to take three fields of data, like: Number, date, and name. Add or merge them together to be placed into a hidden field, then when the user selects the SAVE button I need a script that will get the hid

  • Fixed amount discount at service level.

    Hi, I have created WO & i have entered discount for service for fixed amount. Eg: WO service value  qty = 10 & value = 100 = 1000 rs fixed amount discount = 100 But while creating service entry at first service entry system show total discount. servi