summaryrefslogtreecommitdiff
path: root/src/com/benburwell/planes/gui/AircraftTableComponent.java
blob: 221bdda1dde7ef6cfe130dc3d964b255c6dd31e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.benburwell.planes.gui;

import com.benburwell.planes.data.AircraftStore;

import javax.swing.*;

/**
 * Created by ben on 11/17/16.
 */
public class AircraftTableComponent implements ViewComponent{
    private JTable table;
    private AircraftTableModel tableModel;
    private JScrollPane scrollPane;

    public AircraftTableComponent(AircraftStore store) {
        this.tableModel = new AircraftTableModel(store);
        this.table = new JTable(this.tableModel);
        this.table.setFillsViewportHeight(true);
        this.scrollPane = new JScrollPane(table);
    }

    @Override
    public JComponent getComponent() {
        return this.scrollPane;
    }
}