Can't get image in the scroll pane.

I have written a program to show image in scrollpane. Image has put in the same directory of program. But Still I am not getting image in the scroll pane.
Please have a look into program and let me know where I commit mistake.
package com.lko.fx.controls;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
* @author Upadhyay
public class ScrollPaneFx extends Application{
private Scene scene;
private Group root;
* @param args
public static void main(String args[]){
launch(args);
* @param primaryStage
* @throws Exception
@Override
public void start(Stage primaryStage) throws Exception {
root = new Group();
scene = new Scene(root, 300, 240, Color.WHITE);
scrollPaneDemo();
primaryStage.setTitle("ScrollPane Demo");
primaryStage.setScene(scene);
primaryStage.show();
private void scrollPaneDemo() {
ImageView imgView = new ImageView(new Image(this.getClass().getResourceAsStream("img.png")));
ScrollPane spane = new ScrollPane();
spane.setContent(imgView);
root.getChildren().add(spane);
Thanks in Advance!
Regards,
Himanshu

Ok, check whether it is the image loading or something else in your code. Is the result of the getClass().getResource() method null or not null? Once we know that we know which direction to hunt in.
Also I assume you are running in an IDE. Which one? Make sure the build picks up images. Maven for example won't pick them up from your 'src/java' directory.

Similar Messages

  • I want to click to open the message but it is opening when I select it, and I can't get rid of the open Pane below the messages.

    I want to click to open the message but it is opening when I select it, and I can't get rid of the open Pane below the messages.

    Excellent. Thank you very much...

  • How can I get rid of the dark area on top one third of my iphone screen which spoils my background image?

    How can I get rid of the dark area on top one third of my iphone screen which spoils my background image?
    It seems this problem is caused by the software to increase the readibility of upper letters (clock battery etc.) It be nice to leave us the control of choosing background letter color too if we are using brighter images or darker images.
    I'm using iphone 4s and it appeared after I updated to new patch. 7.1.1.
    Thanks,
    Cem
    I do not know how to move topics from sections of forum so I apologise for duplicate post.
    https://discussions.apple.com/message/25594879#25594879

    Photo added.

  • I can't get rid of the "Install OS X" disk image...

    Several months ago (I think it was when upgrading from 10.6.2 to 10.6.3) I had trouble with two machines - my wife's MBA (Rev. A - 1.6 GHz, 2GB ram, 80 GB HDD), and my MBP, but our iMac did fine. Eventually I got both the MBA and MBP updated and they work fine. Since then I've updated the MBA so that it's running 10.6.4.
    Here's my problem: during the difficult software update somehow I was left with two (2!) "Install OS X" disk images on the MBA desktop. I cannot get rid of them no matter what I do. I've tried ejecting (and they eject - but then when you reboot the computer they come right back), I've tried using disk utility to erase them, I've tried numerous things but I can't get rid of the darn things.
    I'd given up because they weren't causing any harm. However, I've just realized I can't run TimeMachine because of the disk images - TimeMachine stops with an error message saying it can't back up two disks with the same name. I can't change the name or delete the disk images so I can't do backups.
    Any ideas on how to get rid of these silly things?

    OK, then open Disk Utility. Click on the main drive entry at the top of the sidebar list, then click on the Partition tab in the DU main window. You should see a window in which you have the three partitions displayed as rectangles one on top of the other. I'm assuming that in your case the largest rectangle is the uppermost one with the two mystery partitions at the bottom. Click in one of the smaller rectangles. You should see it become outlined in blue. Then click on the [-] Delete button. Repeat for the second small rectangle. You will now have a gray area below your OS X partition. Now click on the Apply button. It may take several minutes for the process to complete so be patient and wait until it's done. When it's finished you should see the topmost OS X partition and the remainder of the window is gray space. In the lower right corner of the OS X partition should be a sizing gadget that looks like a triangle. Use the mouse to drag the corner all the way to the bottom of the window. Click on the Apply button and wait for the process to be completed.
    This should restore your drive to it's original single volume state and get rid of the two mystery items.

  • Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to be?

    Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to look?
    Everyone who logs into Facebook on my Firefox has this problem however if we use Internet Explorer - facebook looks normal.

    If you have increased the minimum font size then try the default setting "none" as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"

  • I have a Australian iTunes account and want to switch to using the u.s store as I now live there, I cannot do this because I have $1.41 still in the oz account an image to have a zero balance to change stores, how can I get rid of the $1.41?

    I want to switch to the u.s store as I now live in the us, I cannot switch stores because my balance is $1.41 in the oz store and needs to be zero, how can I get rid of the $1.41 when everything costs more or less than that? I do not have a credit card on the oz iTunes account an I cannot use my us one to top it up.
    HELP

    Click here and request assistance.
    (60992)

  • Putting an image in a scroll pane

    This is probably a simple question for most of you, but I need a little bit of help. How do I put a picture in a scroll pane?
    The problem I have is that I can load an image and display it, that works fine. However, let's say I am making a new frame (I generally use JFrames), and I want to have a scroll pane in it. Let's also say I have numerous buttons around the edges (using a BorderLayout, or something). How do I load an image, draw the image on-screen and have it so that it only shows up in the scroll pane without the scrollbars disappearing?
    I try to do it now, but for some reason the scroll bars of the scroll pane never show up. I can make the entire image be displayed by dragging the window edges bigger (the normal way you make windows bigger), and then I can see the entire picture. Unfortunately, the scroll bars on the scroll pane never show up if the window is too small to display the entire image. This is very puzzling, because I really don't know what I'm doing wrong. I have tried putting a panel in the scroll pane, and drawing on the panel, but still no scroll bars show up on the scroll pane if it is not big enough to show the entire picture / panel.
    I am sure that the solution is very simple, but right now that solution eludes me.

    There's an example in the swing tutorials that seems to me to do exactly what you want.
    See if http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html does the job, (less the border layout and buttons of course, but that shouldn't be too hard once you get the scroll bars working).
    I believe the default scrollbar policy will let the scroll bars appear only when needed based on the bounds and the preferred size.
    I used the example to set up a scrolling map (still just a gif image) and it works fine. If you still have trouble, you probably need to post the relevant section of code.

  • Can I get rid of the underlined hyperlink and just have roll-over links?

    In iWeb 2009, can I get rid of the underlined hyperlink and just have roll-over links?

    You have to put them on the server where you are publishing your site to. Where are you hosting your site? If it's a MobileMe account then you have two options:
    1 - put the photos in a folder, name it "Pics" and put that folder in your iDisk/Pictures folder. Then use the following URL: http://homepage.mac.com/YourMMe_Account_Name/.Pictures/Pic/FileName (don't forget the period before Pictures).
    2 - put the "Pics" folder with image files in your iDisk/Web/Sites folder and use the following URL: http://web.me.com/YourMMe_Account_Name/FileName.
    If you're hosting on a 3rd party server it would depend on if you're using a domain name or not. I'm not familiar with 3rd party servers so Wyodor, Ethmoid or someone that is will need to point the way.

  • My iPad is disabled, but I know the passcode.. When i connect it to iTunes it says it can't access it because it has a passcode. How can i get rid of the passcode without resetting the iPad? And if there is no way to do so, how do I completely reset it?

    My iPad is disabled, but I know the passcode.. When i connect it to iTunes it says it can't access it because it has a passcode. How can i get rid of the passcode without resetting the iPad? And if there is no way to do so, how do I completely reset it?

    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.htmlhttp://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tbhttp://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Devicehttp://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htmhttp://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just canceling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • HOW CAN I GET RID OF THE EVENTS CATEGORY?

    There are days that I will add only one picture to iPhoto and it becomes an event. Every time I add a new picture to iPhoto 8 I get a new event. This past week I have been renaming some albums and adding new albums and folders and that has had a very undesired result of now telling me I have 26,624 items in 3,071 events. That, 26,624 number, incidentally, is the same number of photos I have in iPhoto.
    If I try to delete an event, I find I am also deleting the pictures in that event from my main iPhoto library. I have also noticed that the events in my events area are randomly numbered, not in any sort of order.
    HELP!!!!!!!!!!!!!!!!!!!!!!!!!!
    Also, iPhoto 8 does not recognize my camera (Canon PowerShot S5IS) when I try to add photos to iPhoto.

    cmiles:
    Welcome to the Apple Discussions. You can't get rid of the Events mode as it's the basic container feature of iPhoto which is organized by date. You can always drag that single event onto another one in the Event mode to join them, thus getting rid of the single event. You can also do that in the Photos mode, with Event names displayed so it's like the old rolls, by dragging a photo or photos into another event.
    Regarding the problem of the camera not being recognized that's a tougher problem to fix. A workaround is to use Image Capture to upload the photos to a folder on the desktop and then import the folder into iPhoto.
    One user fixed his similar problem with an Archive and Install of Leopard and a reinstall of iPhoto from the disk it came on. As I said, not as easy a fix.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Can't get rid of the space at the top of my page!

    can't get rid of the space at the top of my page!
    http://www.songsaboutthenews.com
    Real simple table, centered, with background image. Can't get
    the space at the top of the page to go away. Much mucking with the
    inline style sheets to no avail. Help is appreciated!

    mixmasterdsr04 wrote:
    > can't get rid of the space at the top of my page!
    >
    >
    http://www.songsaboutthenews.com
    >
    > Real simple table, centered, with background image.
    Can't get the space at the
    > top of the page to go away. Much mucking with the inline
    style sheets to no
    > avail. Help is appreciated!
    >
    Hi,
    Edit the background image to remove the white at the top or
    adjust your
    css like so......
    body {
    background-color: #FFF;
    background-image: url(bk.jpg);
    background-repeat: repeat-x;
    background-position: center -20px;
    margin: 0;
    padding: 0;
    chin chin
    Sinclair

  • Can't get rid of the black

    http://dealeradbrowser.com/newsletters/august2013.html
    I can't get rid of the black under the guy.
    I can't find it in the code. No borders. No padding.
    Any suggestions?
    Thank you.

    OK change the code to look like this:
    <img style="display: block;" src="http://dealeradbrowser.com/images/salesman3.png" width="255" height="342"  border="0" alt=""/>
    Look at the bold text that needs to be added and it should work.
    Good luck.

  • IChat Error: "Can't get video from the camera"

    When I try to Screen Share with iChat on a local network, I receive the error "Can't get video from the camera" when I have an external camera plugged into the FW400 port on my Mac Mini. The Screen Sharing feature works great when the camera is not connected. Anyone know why this is and how to fix it?

    Tell us about the Network you created please.
    What make and model modem ?
    Can it route (issue IPs) ?
    IS there a router ?
    Make and model of that please ?
    If there are two devices which is doing DHCP if any are ?
    IS there any computer that is sharing it's Internet Connection with any other computer ?
    I take it from the title and the post that you infer you can Video and Audio chat ?
    The Cannot get Video from Camera normally gets and Error Log pop up.
    This can be opened with the reveal triangle on the left. The Details shown will have a Error number. Do you know what this log says ? (normally Error 20 or 21)
    Old logs are stored in Users/(your account)/Library/Logs/iChatConnectionErrors by date.
    IF you post an Error Log stop at the line that Says "Binary Images for iChat" as we don't need the bits below that yet.
    As the Screen share in iChat uses an Audio component then the Camera if it is also the Mic needs to be ON.
    In your case this may mean that in the ichat Video Menu both Camera Enabled and Mic Enabled should both be ticked.
    (I have never seen an iChat error code for not (specifically) being able to get the Mic input so the message might be the only one iChat can pop up)
    It does seem very odd that it only effecting Screen Sharing.
    I have a Firewire connected DV converter that has two Firewire ports itself so I can input the camera feed to two computers. When this is in place the System also sees it as a Network.
    I have also heard of one person with a Firewire Stills camera and I think the Storage space was seen as an External Device and therefore appeared Networked which is why I asked the first set of questions.
    iChat does not like being in Two networks (a modem that issues IP address and a router doing the same or Wireless to a neighbour and Ethernet to your Own Internet connection, the Mac being the hub in a Share Internet connection, Wireless and Ethernet to the same router and using Parallels when set to Share the Mac's IP are the most common)
    The Screen Sharing option in iChat > Video Menu is ON ? (at both ends ?)
    As iChat's Screen Sharing is related to the System Screen Sharing and therefore Apple Remote Desktop you may find that in any routing device you may have to open ports 5900 and 5988 if not using UPnP
    http://support.apple.com/kb/TS1629?viewlocale=en_US
    You said Local Network. Do you mean this is using the Bonjour Buddy List ?
    11:21 AM Saturday; June 14, 2008

  • I am trying to setup my ipad 2 but I can't get back to the wi-fi connections section.  How do I get there, nothing is working.

    I am trying to setup my ipad 2 but I can't get back to the wi-fi connections section.  How do I get there, nothing is working.

    The Wi-Fi connections section is in Settings > Wi-Fi
    If the home screen is not visible tap the Home button, the button on the front of your iPad that has the rounded square in it. Once you reach the Home screen swipe through the screen of apps until you find the Settings app. Tap Settings and go to Wi-Fi.
    If your iPad is completely non responsive, try a restart.
    Press and hold the Home button and the Sleep button simultaneously ignoring the red slider. Keep holding until the Aple logo appears and your iPad will restart.
    The sleep button is on the side of your iPad on the side opposite from the Home button.

  • How can i get acsess to my data if my iphone is shut and can´t open any more??how can i get acsess to the memory card, how can i get acsess to my data if my iphone is shut and can´t open any more??how can i get acsess to the memory card

    how can i get acsess to my data if my iphone is shut and can´t open any more??how can i get acsess to the memory card????please help

    You can't. There is no memory card. It uses flash memory that's soldered to the logic board. If you didn't back it up, your data is gone.

Maybe you are looking for