the tabs are in 2 seperate classes and they are built over a main app that links it all together. Bellow is the code for the main app
the tabs should be linked as follows
1. detailPane with two textfields and one combo box
2. My instructor said to add a ScrollPane and then link a table to it using TableModel for the 2nd tab
along with the tabs right bellow should be a status label and another button that switches the tabs when clicked.
bellow is the code.
package MobileCalendar;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.ListModel;
import javax.swing.border.BevelBorder;
import javax.swing.event.ChangeEvent;
public class MobileCalendar extends javax.swing.JApplet implements java.awt.event.ActionListener, javax.swing.event.ChangeListener {
/**
*
*/
private static final long serialVersionUID = 1L;
private DetailPane detailPane;
private EventList myList;
private JButton newEventButton;
private JLabel statusLabel;
private JScrollPane summaryPane;
private JTabbedPane tabs;
Graphics g;
JPanel canvas;
/*
* Handles all button clicks
*/
public void actionPerformed(ActionEvent evt) {
String command = evt.getActionCommand();
if (command.equals("Enter New Event")){
}
}
/*(
* Lay out the applet with status label, tabbed pane, and new event button
*/
public void init(){
JPanel detailPane = new JPanel(new BorderLayout());
JTabbedPane tabs = new JTabbedPane();
detailPane.add(tabs);
detailPane.add(newEventButton);
detailPane.add(statusLabel);
/*
Container pane;
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
newEventButton = new JButton("CLICK FOR NEW EVENT");
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 40; //make this component tall
c.weightx = 0.0;
c.gridwidth = 3;
c.gridx = 0;
c.gridy = 1;
pane.add(newEventButton, c);
*/
}
/*
* If 'tabs' has been changed to the detail view and there is a
* selected summary, display its details on the Details view
*/
public void stateChanged(ChangeEvent evt) {
// TODO Auto-generated method stub
}
}
Edited by Dogstopper:
This post has been edited by Dogstopper: 30 October 2010 - 12:44 PM

New Topic/Question
Reply




MultiQuote




|