User Tools

Site Tools


guides:tutorials:java-eclipse

Using DK.JAVA with Eclipse

Documentation | Tutorials | Using Eclipse

To use DK.JAVA with Eclipse please follow this steps:

  1. Unzip package in a directory of your choice
  2. You must include in Referenced Libraries at least:
    • tatukgis.jdk.jar
    • sugar.jdk
    • cooper.jar
  3. Import tatukgis.jdk namespace to use any class, e.g. TGIS_ViewerWnd

Sample code

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import tatukgis.jdk.TGIS_ViewerMode;
import tatukgis.jdk.TGIS_ViewerWnd;
import tatukgis.jdk.TGIS_Utils;
 
class ApplicationFrame extends JFrame
{
  private TGIS_ViewerWnd gis;
 
  private void createGUI()
  {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
    gis = new TGIS_ViewerWnd();
    gis.setPreferredSize(new Dimension(800, 600));
    add(gis, "Center");
 
    pack();
    setVisible(true);
  }
 
  public ApplicationFrame(String _title)
  {
    setTitle(_title);
 
    createGUI();
    gis.setMode(TGIS_ViewerMode.Zoom);
    gis.Open(TGIS_Utils.GisSamplesDataDir() + "\\World\\Countries\\Poland\\DCW\\poland.ttkgp");
  }
}
2017/09/04 11:40