plz tell the codes and/or logic to use the JXMapkit. I am using the swingx-ws-1.0.jar package in eclipse IDE. If a better (newer) package is available plz post the download link. Im trying to add the JXMapkit onto a JPanel with the following code but i’m unsuccessful in that also:
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.jdesktop.swingx.JXMapKit;
import java.awt.*;
public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame();
JXMapKit kit = new JXMapKit();
JPanel parentPanel = new JPanel();
parentPanel.setLayout(new BorderLayout());
parentPanel.add(kit, BorderLayout.CENTER);
frame.setContentPane(parentPanel);
frame.pack();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
error lies in the following line:
parentPanel.add(kit, BorderLayout.CENTER);
I found the answer in the following link:
http://www.jarvana.com/jarvana/view/org/swinglabs/swingx-ws/1.0/swingx-ws-1.0-sources.jar!/org/jdesktop/swingx/JXMapKit.java?format=ok
works perfectly.
It requires the following reference libraries: