java - Build MOJO with Javafx 8 -
i looking find example on building mojo application using javafx 8. have small application of mojo using swings , awt. trying replace usage of swing , awt using javafx. confused on how integrate mojo javafx. on providing examples should enough me further research on application.
below mojo program using swing , awt.
import javax.swing.jframe; import java.awt.event.*; import java.awt.*; import com.esri.mo2.ui.bean.map; import com.esri.mo2.ui.tb.zoompantoolbar; import com.esri.mo2.ui.bean.layer; import com.esri.mo2.ui.bean.toc; public class quickstart2 extends jframe { map map = new map(); layer layer = new layer(); layer layer2 = new layer(); toc toc = new toc(); string s1 = "c:\\esri\\moj20\\samples\\data\\usa\\states.shp"; string s2 = "c:\\esri\\moj20\\samples\\data\\usa\\capitals.shp"; zoompantoolbar zptb = new zoompantoolbar(); public quickstart2() { //add title window super("quick start"); //set size this.setsize(400, 300); //add map frame zptb.setmap(map); toc.setmap(map); getcontentpane().add(map, borderlayout.center); getcontentpane().add(zptb,borderlayout.north); //add shape file map addshapefiletomap(layer,s1); addshapefiletomap(layer2,s2); //add toc getcontentpane().add(toc, borderlayout.west); } private void addshapefiletomap(layer layer,string s) { string datapath = s; //"c:\\esri\\moj20\\samples\\data\\usa\\states.shp"; layer.setdataset("0;"+datapath); map.add(layer); } public static void main(string[] args) { quickstart2 qstart = new quickstart2(); qstart.addwindowlistener(new windowadapter() { public void windowclosing(windowevent e) { system.out.println("thanks, quick start exits"); system.exit(0); } }); qstart.setvisible(true); } }
below output of program.
i running above program using moj_compile program.java , moj_run program . have moj_compile , moj_run batch files pointed jdk8.
Comments
Post a Comment