dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Need Java Help Error says cannot find symbol symbol:class MyField location FXView.FX

  1. #1
    Join Date
    Oct 2012
    Posts
    18

    Need Java Help Error says cannot find symbol symbol:class MyField location FXView.FX

    First of all this program was error free and some how (like a dumb @zz) I deleted one of the classes.

    Everything's fine now until it gets to the MyField part and They are not freakin Classes!!!

    I know it's something small and My brain farting self is just out right over looking it.

    Please Help!!!
    Code:
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package fxtable;
    
    /**
     *
     * @author jst0009
     */
    import javafx.application.Application;
    import javafx.beans.property.FXModel;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.geometry.Insets;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Font;
    import javafx.stage.Stage;
     
    public class FXView extends Application {
     
        private final TableView<FXModel> table = new TableView<>();
        private final ObservableList<FXModel> data = 
           FXCollections.observableArrayList(
                new FXModel( 1, 21, " ",""),
                new FXModel( 2,21 , " ",""),
                new FXModel( 21,21 , " ",""),
                new FXModel( 17,17 , " ",""),
                new FXModel( 28, 82, " ",""),
                new FXModel( 112,111 , " ",""),
                new FXModel( 131,131 , " ","")
                
            );     
        public static void main(String[] args) {
            launch(args);
        }
     
        @Override
        public void start(Stage stage) {
            Scene scene = new Scene(new Group());
            stage.setTitle("Jaytees Table App");
            stage.setWidth(300);
            stage.setHeight(500);
     
            final Label label = new Label("My Table");
            label.setFont(new Font("Arial", 20));
     
            table.setEditable(true);
     
            TableColumn dataFieldOne = new TableColumn("Data One");
            dataFieldOne.setMinWidth(100);
            dataFieldOne.setCellValueFactory(
                    new PropertyValueFactory<>("dF1"));
            TableColumn dataFieldTwo = new TableColumn("Data Two");
            dataFieldTwo.setMinWidth(100);
            dataFieldTwo.setCellValueFactory(
                    new PropertyValueFactory<>("dF2"));
            TableColumn equalualities = new TableColumn("Equality");
            equalualities.setMinWidth(100);
            equalualities.setCellValueFactory(
                    new PropertyValueFactory<>("equal"));
            TableColumn differences = new TableColumn("Diferences");
            differences.setMinWidth(100);
            differences.setCellValueFactory(
                    new PropertyValueFactory<>("diff"));
            
            
            table.getColumns().addAll(dataFieldOne, dataFieldTwo, equalualities, differences);
     
            final VBox vbox = new VBox();
            vbox.setSpacing(5);
            vbox.setPadding(new Insets(10, 0, 0, 10));
            vbox.getChildren().addAll(label, table);
     
            ((Group) scene.getRoot()).getChildren().addAll(vbox);
     
            stage.setScene(scene);
            stage.show();
        }
        
        public class FXModel {
        private final MyField dataFieldOne;
        private final MyField dataFieldTwo;
        private final MyField equalities;
        private final MyField differences;
     
        private FXModel(int dF1, int dF2, String equal, String diff) {
            this.dataFieldOne = new MyField(dF1);
            this.dataFieldTwo = new MyField(dF2);
            this.equalities = new MyField(equal);
            this.differences = new MyField(diff);
        }
     
        public String getDataFieldOne() {
            return dataFieldOne.get();
        }
        public void setDataFieldOne(int dF1) {
            dataFieldOne.set(dF1);
        }
            
        public String getDataFieldTwo() {
            return dataFieldTwo.get();
        }
        public void setDataFieldTwo(int dF2) {
            dataFieldTwo.set(dF2);
        }
        
        public String getEqualities() {
            return equalities.get();
        }
        public void setEqualities(String equal) {
            equalities.set(equal);
        }
        public String getDifferences() {
            return differences.get();
        }
        public void setDifferences(String diff) {
            differences.set(diff);
        }
            
    }
        
    }

  2. #2
    Join Date
    Apr 2010
    Posts
    13

    Re: Need Java Help Error says cannot find symbol symbol:class MyField location FXView

    would you post the FxView.fxml content if there is such file? and the exception trace could be helpfull too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)