Skip to main content

Cannot find JXMapViewer in SwingX 0.9.5.jar

10 replies [Last post]
scawa
Offline
Joined: 2009-02-03
Points: 0

I am trying to learn to use SwingX in NetBeans and am having a few problems. I planned to attempt to duplicate the java.net article by Joshua Marinacci on Building Maps into Your Swing Application with JXMapViewer.

So:

1) I downloaded swingx-0.9.5.jar and swingx-beaninfo-0.9.5.jar and cannot find the Class JXMapKit OR JXMapViewer in either jar. The article says it should be in the org.desktop.swingx package, but it's not there. I cannot find any news that JXMapViewer is no longer part of the project.

2) I created a standard desktop app with NetBeans. Both the jar files are part of my libraries as suggested in the above article. However, when I attempt to drag ANY class over to the JPanel in the app, it doesn't work. I have been able to create custom classes based upon JPanel and drag them onto the App, but none of the SwingX component classes work.

Where is JXMapViewr located??

Is there something else I have to do to configure NetBeans to use the swingx component classes in Mattise?

Is there some documentation on adding SwingX components to the Component Pallet?

Thanks

Stephen McConnell

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
punkck
Offline
Joined: 2012-05-29
Points: 0

I didnt read all the comments below ! (sorry for being so lazy)

but if u havnt got the swingx for jmapviewer its because the java.net has been transfered to kenai infrastructure, because of which most of the download links are broken. So here is the barebone view of release http://java.net/downloads/swingx/
download the swingx-all and add it to your library and then add JXMaoKit to your pallet in Netbeans then you can add the Map in your form.

leostereo69
Offline
Joined: 2011-07-04
Points: 0

Hello Mr Scawa, Im having the same problem ... readed that you solved, would you explain to me how ?

my msn contact is bolivianoleo@hotmail.com

Bye!

scawa
Offline
Joined: 2009-02-03
Points: 0

Ok. In the continuing effort to solve my problem here, I found a thread in the forum on how to add a component to the NetBeans Palette.

http://forums.java.net/jive/thread.jspa?threadID=47191&tstart=225

Another important thing to do here is to create a [projectDir]/lib folder and move the jar files required to that one. Then, AND ONLY THEN can one add them to the Netbeans Libraries and you can drag the actual Class file from the library AS WELL as the Palette component.

I followed the instructions and had to "restart" Netbeans. But the JXMapViewer and JXMapKit are added to the palette and can be added to the app.... I'm got the following exception when I ran the test app

Feb 4, 2009 1:14:38 PM org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner run
SEVERE: Failed to load a tile at url: http://maps.joshy.net/tiles/bmng_tiles_3/3/0/1.jpg, retrying
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
at java.net.URL.openStream(URL.java:1009)
at org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner.cacheInputStream(AbstractTileFactory.java:348)
at org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner.run(AbstractTileFactory.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:637)

It appears that Default Map server is on the SwingLabs server. Right now, it appears the SwingLab Server is DOWN!!!!!!!!! (I have not been able to access the SwingLabs site but once all day.)

Anyway. I can access the defaultProvider property in the Bean and change it to "Open Street Maps". And the app works well.

More in the saga of this later.

Stephen McConnell
"You are either part of the problem or part of the solution.... Or maybe a precipitant or colloidal suspension."
-- Lamar Stephens

rah003
Offline
Joined: 2004-05-26
Points: 0

> java.util.concurrent.ThreadPoolExecutor$Worker.run(Thr
> eadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:637)
> ppears that Default Map server is on the SwingLabs
> server. Right now, it appears the SwingLab Server
> is DOWN!!!!!!!!! (I have not been able to access
> the SwingLabs site but once all day.)
>
Thanks for notification, server should be up and running in few minutes.

scawa
Offline
Joined: 2009-02-03
Points: 0

While the SwingX site is up and working, for some reason the "Tile Server" is still refusing connections.

http://maps.joshy.net/tiles/bmng_tiles_3/3/0/1.jpg

If this is not a valid server any more, then what is a Valid server and shouldn't the defaultProvider be changed to a correct server?

Stephen McConnell
"We are all born ignorant. One has to work hard to remain stupid."
-- Benjamin Franklin

Message was edited by: scawa

scawa
Offline
Joined: 2009-02-03
Points: 0

Ok. In the continuing effort to solve my problem here, I found a thread in the forum on how to add a component to the NetBeans Palette.

http://forums.java.net/jive/thread.jspa?threadID=47191&tstart=225

I followed the instructions and had to "restart" Netbeans. But the JXMapViewer and JXMapKit are added to the palette and can be added to the app.... I'm getting the following exception when I run the test app

Feb 4, 2009 1:14:38 PM org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner run
SEVERE: Failed to load a tile at url: http://maps.joshy.net/tiles/bmng_tiles_3/3/0/1.jpg, retrying
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
at java.net.URL.openStream(URL.java:1009)
at org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner.cacheInputStream(AbstractTileFactory.java:348)
at org.jdesktop.swingx.mapviewer.AbstractTileFactory$TileRunner.run(AbstractTileFactory.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:637)

but I'm working on it.... Will keep things posted as I figure it out here.

Stephen McConnell
"You are either part of the problem or part of the solution.... Or maybe a precipitant or colloidal suspension."
-- Lamar Stephens

kschaefe
Offline
Joined: 2006-06-08
Points: 0

> Where is JXMapViewr located??

JXMapViewer is in the SwingX-WS area. That is not part of the SwingX release.

Karl

rah003
Offline
Joined: 2004-05-26
Points: 0

> Where is JXMapViewr located??
It is part of swingx-ws which was not officially released yet. I'll try to pull the release over the weekend. In the mean time you can download the weekly build from http://www.swinglabs.org/downloads.jsp

> Is there something else I have to do to configure
> NetBeans to use the swingx component classes in
> Mattise?
> Is there some documentation on adding SwingX
> components to the Component Pallet?

There should be some documentation on the wiki and it have been discussed in this forum as well. I don't have the direct link, but it should not be that hard to find out. If I remember properly it boils down to adding swingx as a library and including both swingx.jar and swingx-beaninfo.jar
The Netbeans team had expressed interest in writing their own swingx-beaninfo.jar (which was the reason for splitting the jars in a first place), but I haven't heard from them for while so no clue on what is going on there.

HTH,
Jan

scawa
Offline
Joined: 2009-02-03
Points: 0

I found the JXMapKit classes. I had done a previous search of this forum using the Search Feature and did not find any reference to it. However, I've been manually searching through ALL the posts and found several requests similar to mine. Thanks, however for answering mine.

However, I STILL cannot drag a class over to an applications JPanel (or other componenet) and get it to paint there.

How does one get that to work? This article

http://today.java.net/pub/a/today/2007/10/30/building-maps-into-swing-ap...

says that from NetBeans 6.0 and up (I'm using 6.5 on a Mac) can drag a class over to the app and it shows up there. The illustrations in the article also show the author doing this.

Do I have to use the "Source" code in the project or what?

Oh. By the way... I found several articles on configuring new "beans" into the NetBeans Palette. It doesn't look very difficult. However, one needs some type of "icon" for the bean to get it to look fancy. Are there any "icons" for the SwingX-WS components? Or should we create them?

Stephen McConnell
"Boredom is a personal defect."
-- Lamar Stephens

Message was edited by: scawa

rah003
Offline
Joined: 2004-05-26
Points: 0

> Oh. By the way... I found several articles on
> configuring new "beans" into the NetBeans Palette.
> It doesn't look very difficult. However, one
> needs some type of "icon" for the bean to get it to
> look fancy. Are there any "icons" for the
> SwingX-WS components? Or should we create them?

There are no such icons at the moment, simply because there is just no one in the team with the right skill set to create them (or if they is someone, then this person is too shy to mention (s)he can do it). If you can do it, or know anyone willing to donate such art work we will be more then happy to accept such contribution.
Speaking of art work, long long ago there was also talk of some logo for whole swinglabs project, something like image of Duke in a lab coat or something similar, but no one was able to create decent image of that either :)