Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:10:11+00:00 2026-06-06T03:10:11+00:00

I am using Eclipse on Windows XP. I downloaded the GeoTools 2.7.4-bin.zip file and

  • 0

I am using Eclipse on Windows XP. I downloaded the GeoTools 2.7.4-bin.zip file and started to add some .jar files to my project.
The particularity of my project is that this is an Android one.

I am developing an Android application that would allow me to show on a map (google map) some features (points but not only) so i tried to use GeoTools to do that.But Android is not supporting Swings.
My code is

/*code i m using */

package info.ipower.geotools;

import java.io.File;

import org.geotools.data.FileDataStore;

import org.geotools.data.FileDataStoreFinder;

import org.geotools.data.simple.SimpleFeatureSource;

import org.geotools.map.FeatureLayer;

import org.geotools.map.Layer;

import org.geotools.map.MapContent;

import org.geotools.styling.SLD;

import org.geotools.styling.Style;

import org.geotools.swing.JMapFrame;

import org.geotools.swing.data.JFileDataStoreChooser;


/**
 * Prompts the user for a shapefile and displays the contents on the screen in a map frame.
 * <p>
 * This is the GeoTools MapApplication application used in documentationa and tutorials. *
 */

public class GeoMap{

    /**
     * GeoTools MapApplication demo application. Prompts the user for a shapefile and displays its
     * contents on the screen in a map frame
     */
    public static void main(String[] args) throws Exception {
        // display a data store file chooser dialog for shapefiles
        File file = JFileDataStoreChooser.showOpenFile("shp", null);
        if (file == null) {
            return;
        }

        FileDataStore store = FileDataStoreFinder.getDataStore(file);
        SimpleFeatureSource featureSource = store.getFeatureSource();

        // Create a map content and add our shapefile to it
        MapContent map = new MapContent();
        map.setTitle("MapApplication");

        Style style = SLD.createSimpleStyle(featureSource.getSchema());
        Layer layer = new FeatureLayer(featureSource, style);
        map.addLayer(layer);

        // Now display the map
        JMapFrame.showMap(map);
    }

}

But it giving me following errors in eclipse

-The method showOpenFile(String, Component) from the type JFileDataStoreChooser refers
to the missing type Component

  • The type java.awt.Component cannot be resolved. It is indirectly referenced from
    required .class files
  • The type java.awt.HeadlessException cannot be resolved. It is indirectly
    referenced from required .class files
  • The type javax.swing.JFileChooser cannot be resolved. It is indirectly
    referenced from required .class files
  • The method showMap(MapContext) in the type JMapFrame is not
    applicable for the arguments (MapContent)
  • The type javax.swing.JFrame cannot be resolved. It is indirectly
    referenced from required .class files
    Please any one help me to resolve these errors
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:10:13+00:00Added an answer on June 6, 2026 at 3:10 am

    Unfortunately Swing is not implemented on Android, so you are out of luck. In fact Oracle and Google just fought a big legal battle that was partially about this. I’m pretty sure that porting any serious Swing app or library to Android is a major effort: almost a rewrite from scratch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run csipsimple using eclipse on Windows OS. I downloaded the project
I'm coding a Rails project in a Windows environment and using Eclipse (with the
I would like to do some C++ development on Windows using Eclipse and the
I'm using Eclipse on Windows to program C++ using Cygwin's toolchain. I would like
When using Eclipse over X-Windows on a remote shell (X port forwarding), is there
I'm using Eclipse and the Subversive for SVN control, in Windows. I've also installed
I am using Android SDK 16.1 with Eclipse on Windows. I've set ANDROID_LINT_COMPLETE_REGIONS as
I'm using Java 1.6 , Eclipse , Windows 7. I'm trying to run commands
i'm using eclipse platform and window builder pro within. I've already created new project
I downloaded Eclipse for C++ v 3.6 32-bit version on my Windows 7 64-bit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.