final JFrame frame = new JFrame();
frame.setLayout(new BorderLayout());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setSize(800, 600);
final JHexView hexView = new JHexView();
frame.add(hexView);
final JMenuBar menuBar = new JMenuBar();
final JMenu menu = new JMenu("File");
menu.add(new AbstractAction("Open") {
@Override
public void actionPerformed(final ActionEvent arg0) {
final JFileChooser chooser = new JFileChooser();
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(frame)) {
final File file = chooser.getSelectedFile();
try {
hexView.setData(new SimpleDataProvider(readFile(file)));
hexView.setDefinitionStatus(DefinitionStatus.DEFINED);
hexView.setEnabled(true);
} catch (final IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}