/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package schedule;
/**
*
* @author Kix
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
public class Fourth extends JFrame {
static JLabel lblFaccode,lblFaculty,lblSpace,lblSpace1;
static JButton btnExit;
static JTable tblOne;
static GridBagLayout gbl;
static GridBagConstraints gbc;
public Fourth (String title){
super(title);
gbl=new GridBagLayout();
setLayout(gbl);
gbc=new GridBagConstraints();
lblFaccode = new JLabel("Faculty Code");
lblFaculty = new JLabel("Instructor");
lblSpace = new JLabel(" ");
lblSpace1 = new JLabel(" ");
btnExit = new JButton("EXIT");
Object rows[][] = { { "AMZN", "Amazon", "67 9/16" },
{ "AOL", "America Online", "68 3/4" },
{ "BOUT", "About.com", "56 3/8" },
{ "CDNW", "CDnow", "4 7/16" },
{ "DCLK", "DoubleClick", "87 3/16" },
{ "EBAY", "eBay", "180 7/8" },
{ "EWBX", "EarthWeb", "18 1/4" },
{ "MKTW", "MarketWatch", "29" },
{ "TGLO", "Theglobe.com", "4 15/16" },
{ "YHOO", "Yahoo!", "151 1/8" } };
Object columns[] = { "Symbol", "Name", "Price" };
JTable tblOne = new JTable(rows, columns);
tblOne.setAutoResizeMode (JTable.AUTO_RESIZE_OFF);
gbc.fill=GridBagConstraints.HORIZONTAL;
addComponent(lblFaccode,0,0,1,1);
addComponent(lblSpace,1,0,1,1);
addComponent(lblFaculty,2,0,1,1);
addComponent(lblSpace1,3,0,1,1);
addComponent(tblOne,4,0,10,10);
setVisible(true);
setSize(350,300);
}
public void addComponent(Component c,int row,int col,int width,int height){
gbc.gridx=col;
gbc.gridy=row;
gbc.gridwidth=width;
gbc.gridheight=height;
gbl.setConstraints(c, gbc);
add(c);
}
private void closeWindow(){
addWindowListener(
new WindowAdapter(){
public void windowClosing(WindowEvent we){
System.exit(0);
}
}
);
}
public static void main(String args[]){
Fourth d = new Fourth ("DEPOSIT");
}
}
kiko11 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.