0

Hello there Stackoverflow code lovers, i really need some help with something i have been messing around with, i keep getting the IllegalAccessException ( java.lang.IllegalAccessException: Class sun.reflect.misc.Trampoline can not access a member of class main.TableContent with modifiers) when trying to compile my code.. the sample is below..

Full StackTrace:

  Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.IllegalAccessException: Class sun.reflect.misc.Trampoline can not access a member of class main.TableContent with modifiers "public"

Person class:

 package main;

 import javafx.beans.property.SimpleIntegerProperty;
 import javafx.beans.property.SimpleStringProperty;
 import javafx.beans.property.StringProperty;
 import javafx.collections.ObservableList;
 import sun.java2d.pipe.SpanShapeRenderer;


class TableContent  {

public SimpleStringProperty fecha;
public SimpleStringProperty hora;
public SimpleIntegerProperty folio;
public SimpleIntegerProperty estacion;
public SimpleStringProperty circuito;
public SimpleStringProperty receta;
public SimpleStringProperty usuario;


public String getFecha() {
    return fecha.get();
}

public void setFecha(String v) {
    fecha.set(v);
}

public String getHora() {
    return hora.get();
}

public void setHora(String v) {
    hora.set(v);
}

public Integer getFolio() {
    return folio.get();
}

public void setFolio(int v) {
    folio.set(v);
}

public Integer getEstacion() {
    return estacion.get();
}

public void setEstacion(int v) {
    estacion.set(v);
}

public String getCircuito() {
    return circuito.get();
}

public void setCircuito(String v) {
    circuito.set(v);
}

public String getReceta() {
    return receta.get();
}

public void setReceta(String v) {
    receta.set(v);
}

public String getUsuario() {
    return usuario.get();
}

public void setUsuario(String v) {
    usuario.set(v);
}



public TableContent(String fechax, String horax, Integer foliox, Integer estacionx, String circuitox, String recetax, String usuariox) {

    this.fecha = new SimpleStringProperty(fechax);
    this.hora = new SimpleStringProperty(horax);
    this.folio = new SimpleIntegerProperty(foliox);
    this.estacion = new SimpleIntegerProperty(estacionx);
    this.circuito = new SimpleStringProperty(circuitox);
    this.receta = new SimpleStringProperty(recetax);
    this.usuario = new SimpleStringProperty(usuariox);


}



  }

And this is my ControllerClass... (HELP PLEASE).

  package main;

import java.net.URL;
 import java.util.ResourceBundle;

 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.fxml.FXML;
  import javafx.fxml.Initializable;
 import javafx.scene.control.Button;
 import javafx.scene.control.DatePicker;
 import javafx.scene.control.TableColumn;
 import javafx.scene.control.TableView;
 import javafx.scene.control.cell.PropertyValueFactory;


    public class WindowController implements Initializable {
    @FXML
     private TableView<TableContent> tableView;
     @FXML
     private TableColumn<TableContent, String> getFecha;
     @FXML
     private TableColumn<TableContent, String> getHora;
     @FXML
     private TableColumn<TableContent, Integer> getFolio;
     @FXML
     private TableColumn<TableContent, Integer> getEstacion;
    @FXML
    private TableColumn<TableContent, String> getCircuito;
    @FXML
    private TableColumn<TableContent, String> getReceta;
    @FXML
    private TableColumn<TableContent, String> getUsuario;
    @FXML
    private DatePicker startTime;
    @FXML
    private Button saveToCSV;
    @FXML
    private Button cancel;
    @FXML
    private Button load;
    @FXML
    private DatePicker finishTime;

final ObservableList<TableContent> C = FXCollections.observableArrayList(
        new TableContent("1","5pm",20,50,"hello","world","Juanito"),
        new TableContent("2","5pm",20,5,"hello","world","Juanito"),
        new TableContent("3","5pm",20,60,"hello","world","Juanito"),
        new TableContent("4","5pm",20,7,"hello","world","Juanito"),
        new TableContent("5","5pm",20,80,"hello","world","Juanito")
  );

@Override
public void initialize(URL url, ResourceBundle rb) {
    // TODO

    getFecha.setCellValueFactory(new PropertyValueFactory<TableContent, String>("fecha"));
    getHora.setCellValueFactory(new PropertyValueFactory<TableContent, String>("hora"));
    getFolio.setCellValueFactory(new PropertyValueFactory<TableContent, Integer>("folio"));
    getEstacion.setCellValueFactory(new PropertyValueFactory<TableContent, Integer>("estacion"));
    getCircuito.setCellValueFactory(new PropertyValueFactory<TableContent, String>("circuito"));
    getReceta.setCellValueFactory(new PropertyValueFactory<TableContent, String>("receta"));
    getUsuario.setCellValueFactory(new PropertyValueFactory<TableContent, String>("usuario"));

    tableView.setItems(data);


  }

 }

Help please guys, any help of suggestion is well appreicated..

thanks in advance.. when i try to compile this i get the exception mentioned above... someone tell me why and how to solve please..

J. Wade
  • 11
  • 3

0 Answers0