All pastes #915411 Raw Edit

Unnamed

public java v1 · immutable
#915411 ·published 2008-02-23 19:54 UTC
rendered paste body
/* this is the MainFrame class, notice how "this" is passed to the new controller */public class MainFrame extends JFrame {    public MenuBarView menuBar;    public JFileChooser fileChooser = new JFileChooser();    public MainFrame() {        super();        setTitle("Card Suite");        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        MenuBarController menuBarController = new MenuBarController(this);/* this is the controller, and it fails to compile, saying frame.fileChooser does not exist */public class MenuBarController {    private JFrame frame;    public MenuBarModel model = new MenuBarModel();    public MenuBarView view = new MenuBarView(model);    public MenuBarController(JFrame frame) {        System.out.println(frame.fileChooser);