0% found this document useful (0 votes)
16 views

CS506-Assignment 2 Solution Spring

Uploaded by

Xtylish Mughal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

CS506-Assignment 2 Solution Spring

Uploaded by

Xtylish Mughal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

CS .

506- Web Design and development

Assignment No. 2 Solution

Semester; Spring 2024

Id; Bc180404611

Runners.java

* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license

public class Runner {

static void clear() {

throw new UnsupportedOperationException("Not supported yet. 't); // Generated from


nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
private int id;
private String
name; private
double time;

public Runner() {

public Runner(int id, String name, double time)


{ this.id = id; this.name = name; this.time =
time;

public Runner(String name, double time)


{ this.name = name; this.time = time;
public int getld() {
return id;

public voidsetld(int Mpjunaid id)


this.id = id;

public String getName()


{ return name;
public void setName(String name)
{ this.name = name;

public double getTime() {


return time;

public void setTime(double time)


{ this.time = time;

DbHe1per.java:
package cs506•

import java.sql.*• import j


ava.util.ArrayList; import
java.util.List; import j
avax.swing.JOptionPane; public
class Dbl-lelper {

private Connection connect() { //


UCanAccess connection string
String url= "jdbc:ucanaccess://assests/BC230401111 . ccdb'
Connection conn = null;

// Load the UCanACCess JDBC dri


Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");

// Establish connection
conn = DriverManager.getConnect10n url
} catch (ClassNotFoundException I SQLException e)
{

e.printStackTrace();
JOptionPane.showMessageDialog(null, "Connection to database failed: " + e.getMessage());

return conn;
public boolean insertRunner(String name, double time) { string sql
"INSERT INTO runners(name, time) VALUES(?

try (Connection conn this.connect();


PreparedStatement pstmt = conn.prepareStatement(sql))
{ pstmt. setString(l , name); pstmt.setDouble(2, time);
pstmt.executeUpdate(); return true•
} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Inserting runner failed: + e.getMessage()); return
false•

public List<Runner> getAllRunners() { string sql "SELECT id, name, time


FROM runners ORDER BY name" , List<Runner> runners = new
ArrayList<>();

try (Connection conn this.connect();


Statement stmt = conn.createStatement();
ResultSet rs = stmt. executeQuery(sql)) {

while (rs.next()) {
Runner runner = new Runner(rs.getlnt("id"), rs.getString("name"), rs.getDouble("time"));
runners.add(runner);

} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Fetching runners failed: + e.getMessage()); return

runners;

try (Connection conn = thls.connect();


Statement stmt = conn.createStatement()) { stmt. execute(sql);

} catch (SQLException e
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Deleting all runners failed: " + e.getMessage());

public List<Runner> getTopThreeRunners() {


string sql = "SELECT id, name, time FROM runners ORDER BY time ASC LIMIT 3";
List<Runner> runners = new ArrayList<>();

try (Connection conn = this.connect();


Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql)) {

while (rs.next()) {
Runner runner = new Runner(rs.getlnt("id"), rs.getString("name"), rs.getDouble("time"));
runners.add(runner);

} catch (SQLException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Fetching top three runners failed: + e.getMessage()); return

runners;

MainClass.java:

* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this


license * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this
template package cs506•

import j ava.awt. event.WindowAdapter; import j


ava. awt. event.WindowEvent; import java.util.List;
import j avax. swing.JOptionPane; import
javax.swing.table.DefaultTableModel; public class
MainClass extends javax.swing.JFrame {
public MainClass()
{ initComponents();
dbHe1per = new
DbHe1per()•,
// Add WindowListener to handle window closing event
this.addWindowListener newAVindowAdapter() {,z
@Override public void
windowClosing(WindowEvent e)
{ showDeveloperInfo();
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always regenerated by
the Form Editor.

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jPanell = new javax.swing.JPanel(); jPane12


new javax.swing.JPanel(); jPane13 = new
javax.swing.JPanel(); jLabe12 = new j
avax.swing.JLabel(); jPane14 new
javax.swing.JPanel(); jLabe13 = new
javax.swing.JLabel(); loadDataBtn = new
javax.swing.JButton(); deleteDataBtn = new
javax.swing.JButton(); viewWinnerBtn =- new
javax.swing.JButton(); jPane15 = new
javax.swing.JPanel(); jPane16 new
javax.swing.JPanel(); jLabell = new
javax.swing.JLabel(); jPane17 = new
javax.swing.JPanel(); nameLabel = new
javax.swing.JLabel(); nameTxt = new
javax.swing.JTextField(); timeTxt = new
javax.swing.JTextField(); timeLabel = new
javax.swing.JLabel(); addRunnerBtn = new
javax.swing.JButton(); jPane18 = new
javax.swing.JPanel(); dataLabel = new javax.
swing.JLabel(); jPane19 = new
javax.swing.JPanel(); j ScrollPanel = new
javax.swing.JScrollPane(); j Tablel = new
javax.swing.JTable();

j avax.swing.GroupLayout jPane13Layout = new javax.swing.GroupLayout(jPane13)•


jPane13.setLayout(jPane13Layout);itipp: -r jPane13Layout.setHorizontalGroup( j Panel3
Layout.createParallelGroup(j avax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabe12, j avax.
swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT SIZE,
javax.swing.GroupLayout.DEFAULT SIZE Short.MAX VALUE) jPane13Layout.setVerticalGroup(
jPane13 Layout.createParallelGroup(j avax. swing. GroupLayout.Alignment.LEADING)
.addGroup(jPane13Layout.createSequentialGroup()
.addComponent(jLabe12, javax.swing.GroupLayout.PREFERRED SIZE, 262
javax.swing.GroupLayout.PREFERRED SIZE) .addGap(O, O, Short.MAX VALUE))

jPane14.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

UI", 1, 18)); // NOII 8N

loadDataBtn.setFont(new UI", 1, 18)); // NOII 8N loadDataBtn.


loadDataBtn.addActionListener(new java.awt.event.ActionListener()
{ public void actionPerformed(j ava.awt.event.ActionEvent evt)
{ loadDataBtnActionPerformed(evt);

deleteDataBtn.setFont(new UI", 1, 18)); // NOII 8N


deleteDataBtn.setText("Delete Data");
deleteDataBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt)
{ deleteDataBtnActionPerformed(evt);

viewWinnerBtn.setFont(new java.awt.Font("Segoe UI" l, 18)); // NOII 8N


viewWinnerBtn.setText("View Winner");
viewWinnerBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(j ava.awt.event.ActionEvent evt)
{ viewWinnerBtnActionPerformed(evt);

jPane14.setLayout(jPane14Layout); jPane14Layout.setHorizontalGroup( j
PaneÍ4Layout.createParallelGroup(j avax. swing. GroupLayout.Alignment.LEADING)
.addGroup(jPane14Layout.createSequentialGroup() .addGap(30,

.addGroup(jPane14Layout.createParallelGroup(javax.swmg.GroupLayout.Alignment.TRAILING,
false) .addComponent(viewWinnerBtn, javax.swing.GroupLayout.DEFAULT SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
. addGroup(j avax. swing.GroupLayout.Alignment.LEADING, j Pane14Layout.create
SequentialGroup() .addGap(16, 16, 16)
SIZE, 104
javax.swing.GroupLayout.PREFERRED SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT SIZE Short.MAX VALUE))

jPane14Layout.setVerticalGroup( j Pane14Layout.createParallelGroup(j
avax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPane14Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabe13)
.addPreferredGap(j avax. swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(loadDataBtn)
.addGap(18, 18, 18)
.addComponent(deleteDataBtn)
.addGap(18, 18, 18)
.addComponent(viewWinnerBtn)
.addContainerGap(117, Short.MAX VALUE))

j avax.swing.GroupLayout jPane12Layout = new javax.swing.GroupLayout(jPane12);


jPane12.setLayout(jPane12Layout); jPane12Layout.setHorizontalGroup( j
Pane12Layout.createParalleIGroup(j avax. swing. GroupLayout.Alignment.LEADING)

.addGroup(jPane12Layout.createSequentialGroup()
avax.swing.GroupLayout.Alignment.LEADING)
SIZE javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)) .addContainerGap()) y, j
Pane12Layout.setVerticalGroup( j Pane12Layout.createParallelGroup(j avax. swing.
GroupLayout.Alignment.LEADING)
.addGroup(jPane12Layout.createSequentialGroup()

SIZE javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)


.addPreferredGap(j
avax.swing.LayoutStyle.ComponentPlacement.RELATED)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
.addContainerGap())v

jPane16.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

jLabe11.setFont(new UI", 1, 36)); // NOII 8N jLabell


.setText("Welcome to ABC Marathon");
j avax.swing.GroupLayout jPane16Layout = new javax.swing.GroupLayout(jPane16);
jPane16.setLayout(jPane16Layout); jPane16Layout.setHorizontalGroup( j
Pane16Layout.createParalle IGroup(j avax. swing.
GroupLayout.Alignment.LEADING)
.addGroup(jPane16Layout.createSequentialGroup()
.addGap(207, 207, 207)
.addComponent(jLabel l)
.addContainerGap(javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE))

jPane16Layout.setVerticalGroup( j Pane16Layout.createParallelGroup(j avax. swing.


GroupLayout.Alignment.LEADING)
.addGroup(jPane16Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabell)
.addContainerGap(18, Short.MAX VALUE))

jPane17 java.awt.Color(0, 0, 0)));

nameLabe1.setFont(new UI", 1, 14)); // N0118N nameLabel.setText("Name");

timeLabe1.setFont(new UI", 1, 14)); // NOII 8N


timeLabel.setText("Time");

UI", 1, 18)); // N0118N


addRunnerBtn.addActionListener(new java.awt.event.ActionListener()
{ public void actionPerformed(java.awt.event.ActionEvent evt)
{ addRunnerBtnActionPerformed(evt);

j avax.swing.GroupLayout jPane17Layout = new j avax.swing.GroupLayout(jPane17);


jPane17.setLayout(jPane17Layout);
jPane17Layout.setHorizontalGroup( jPane17Layout.createParallelGroup(javax.swing.G
r upL t.A e E ING
.addGroup(jPane17Layout.createSequentialGroup()
.addGap(51, 51, 51)

. addGroup(j avax. swing.GroupLayout.Alignment.LEADING, j Panel7Layout. create S equentialGroup()

.addGap(18, 18, 18)


.addComponent(timeTxt))
.addGroup(jPane17Layout.createSequentialGroup()
SIZE 61
javax.swing.GroupLayout.PREFERRED SIZE)
.addGap(18, 18, 18)
.addComponent(nameTxt, javax.swing.GroupLayout.PREFERRED SIZE, 746
javax.swing.GroupLayout.PREFERRED SIZED)
.addContainerGap(48, Short.MAX VALUE))
.addGroup(j avax. swing. GroupLayout.Alignment.TRAILING, j Panel7Layout. create SequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT SIZE Short.MAX VALUE)
SIZE 135
javax.swing.GroupLayout.PREFERRED SIZE) .addGap(385, 385, 385))

jPane17Layout.setVerticalGroup( j Panel7Layout.createParalle IGroup(j avax. swing.


GroupLayout.Alignment.LEADING)
.addGroup(jPane17Layout.createSequentialGroup()
.addGap(17, 17, 17)
avax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(nameLabel)
SIZE 31
javax.swing.GroupLayout.PREFERRED SIZE))
.addPreferredGap(j avax. swing.LayoutStyle.ComponentPlacement.UNRELATED)
avax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(timeLabel)
SIZE 31
javax.swing.GroupLayout.PREFERRED SIZE))
.addGap(18, 18, 18)
.addComponent(addRunnerBtn)
.addContainerGap(javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE))

jPane18.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

dataLabe1.setFont(new UI", 3, 18)); // NOII 8N


j avax.swing.GroupLayout jPane18Layout = new javax.swing.GroupLayout(jPane18);
jPane18.setLayout(jPane18Layout); jPane18Layout.setHorizontalGroup( jPanel
8Layout.createParallelGroup(j avax. swing. GroupLayout.Alignment.LEADING)
.addGroup(j avax. swing. GroupLayout.Alignment.TRAILING, j Pane18Layout. create SequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
.addComponent(dataLabe1, javax.swing.GroupLayout.PREFERRED SIZE,
194 javax.swing.GroupLayout.PREFERRED SIZE 32

jPane18Layout.setVerticalGroup( jPane18Layout.createParallelGroup(javax.swing.
roupLayout.Alignment. EADING)
.addComponent(dataLabe1, javax.swing.GroupLayout.DEFAULT SIZE, 24, Short.MAX VALUE)
y,

jPane19.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));


j Table I . setModel(new j avax. swing.table DefaultTableModel(
new Object {

new String [] {
"No", "Name", "Time"

j ScrollPane I . setViewportView(j Table I ) ;


j avax.swing.GroupLayout jPane19Layout = new javax.swing.GroupLayout(jPane19);
jPane19.setLayout(jPane19Layout);
jPane19Layout.setHorizontalGroup( jPane19Layout.createParallelGroup(j
avax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPane19Layout.createSequentialGroup()
.addContainerGap()
.addComponent(j ScrollPane l)
.addContainerGap()) y, jPane19Layout.setVerticalGroup( j
Pane19Layout.createParalleIGroup(j avax. swing. GroupLayout.Alignment.LEADING)
.addGroup(jPane19Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScr011Pane1, javax.swing.GroupLayout.DEFAULT SIZE, 293, Short.MAX VALUE))

j avax.swing.GroupLayout jPane15Layout = new javax.swing.GroupLayout(jPane15);


jPane15.setLayout(jPane15Layout);
jPane15Layout.setHorizontalGroup( jPane15Layout.createParallelGroup(j
avax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPane15Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPane15Layout.createParallelGroup(j
avax.swing.GroupLayout.Alignment.LEADING)
SIZE javax.swing.GroupLayout.DEFAULT
SIZE, Short.MAX VALUE)
. addComponent(jPane19 , j avax. swing.GroupLayout.Alignment.TRAILING
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.DEFAULT SIZE Short.MAX VALUE)

javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED


SIZE) .addGap(O, Short.MAX VALUE

y, jPane15Layout.setVerticalGroup( jPane15Layout.createParallelGroup(j
avax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPane15Layout.createSequentialGroup() .addContainerGa
p()
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addPreferredGap(j avax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE))
y,

j avax.swing.GroupLayout jPanel I Layout = new j avax.swing.GroupLayout(jPanel I );


j Panel I .setLayout(jPanel I Layout); j Panel I Layout. setHorizontalGroup( j Panel I
Layout.createParallelGroup(j avax. swing. GroupLayout.Alignment.LEADING)
.addGroup(jPanellLayout.createSequentialGroup() .addContainerGap(
)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE))

j Panel I Layout. setVerticalGroup( j Panel I Layout.createParalle IGroup(j avax. swing.


GroupLayout.Alignment.LEADING)
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, Short.MAX VALUE)
.addGroup(jPanel I Layout. create SequentialGroup()
SIZE
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addGap(O, O, Short.MAX VALUE))
y,

j avax.swing.GroupLayout layout = new javax.swing


getContentPane().setLayout(layout layout. setHorizontalGroup( layout.
createParallelGroup(javax.
swing.GroupLayout.Alignment.LEADING .addGroup(layout.createSequential
Group()
SIZÊ
javax.swing.GroupLayout.DEFAULT SIZE, javax.swing.GroupLayout.PREFERRED SIZE)
.addGap(O, O, Short.MAX VALUE))
y, layout.setVerticalGroup( layout.
createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(la
yout.createSequentialGroup() .addContainerGap()
SIZE
javax.swing.GroupLayout.DEFAULT SIZE,
javax.swing.GroupLayout.PREFERRED SIZE) .addContainerGap(130,
Short.MAX VALUE))

pack();
setLocationRelativeTo(null); }
// </editor-fold>

private void loadDataBtnActionPerformed(java.awt.event.ActionEvent evt)


{ List<Runner> runners = dbHelper.getAllRunners();
updateTable(runners); dataLabel.setText("All Runners");

private void deleteDataBtnActionPerformed(java.awt.event.ActionEvent evt) {


// Delete all data from the database int confirm = JOptionPane.showConfirmDialog(null, "Do you want to
remove all runners' data from database?"
"Confirm Delete", JOptionPane.YES NO OPTION); if
(confirm JOptionPane.YES OPTION) {
// User confirmed deletion
dbHelper.deleteAllRunners();
updateTable(null); // Clear the
table dataLabel.setText("Data
Deleted");
} else {
// User cancelled deletion
dataLabel.setText("Deletion Cancelled");

private void viewWinnerBtnActionPerformed(java.awt.event.ActionEvent evt) {


// Find the top three runners
List<Runner> runners = dbHelper.getTopThreeRunners(); if (ntnners.isEmpty())
{ dataLabel.setText("No runners available"); return; else {
StringBuilder message = new StringBuilder("Top Three Winners:\n"); for (int i = 0; i <
runners.size(); i++NApp:
Runner runner = runners.get(i);
message.append(i + l).append( .
.append(runner.getName()).append(" with time ") .append(runner.getTime()).append("\
n");

JOptionPane.showMessageDialog(this, message.toString());
// Update or load data into a JTable
DefaultTab1eM0de1 model new DefaultTab1eM0de1()•,
model.setColumnIdentifiers(new String[] {"ID", "Name", "Time"});
for (int i = 0; i < runners.size(); i++) { Runner runner = runners.get(i);
model.addRow(new Object[] {i + l, runner.getName(), runner.getTime()});

updateTable(runners);
// Show developer information after user clicks "OK"

private void showDeveloperInfo()


{ string student1D = "03074960034"
String studentName = "M junaid Qazi"

// Custom message with thanks and developer info


String message = "Thanks for using ABC Marathon!\n\nDeveloped By:" + studentName + " + studentID +

// Display developer information in a message dialog


JOptionPane.showMessageDialog(this, message,
"Developer Info", JOptionPane.1NFORMATION MESSAGE);

private void addRunnerBtnActionPerformedGava.awt.event.ActionEvent evt) {


// Add a new runner to the database String name =
nameTxt.getText(); double time; try { time =
Double.parseDouble(timeTxt.getText());
} catch (NumberFormatException e) {

return•
return;

boolean success = dbHelper.insertRunner(name, time);


if (success) {
List<Runner> runners =
dbHelper.getAllRunners(); updateTable(runners);
nameTxt.setText(""); timeTxt.setText("");
dataLabel.setText("Runner Added");
} else { dataLabel.setText("Failed to add
runner");

private void updateTable(List<Runner> runners) {


DefaultTab1eM0de1 model = (DefaultTab1eM0de1) jTab1e 1.getM0de1();
model.setRowCount(0); // Clear the existing rows
if (runners != null) { for (Runner runner : runners) { model.addRow(new Object[]
{runner.getld(), runner.getName(), runner.getTime()});

@param args the command line arguments

public static void main(String args[]) {


/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

try { for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus" .equals(info.getName())) { j
avax.swing. break;

} catch (ClassNotFoundException ex)


{ java.util.logging.Logger.getLogger(MainClass.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex); } catch (InstantiationException ex)
{ java.util.logging.Logger.getLogger(MainClass.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex); } catch (IllegalAccessException ex)
{ java.util.logging.Logger.getLogger(MainClass.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex); } catch (javax.swing.UnsupportedLookAndFeelException ex)
java.util.logging.Logger.getLogger(MainClass.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable()
{ public void run() { new
MainClass().setVisible(true);
// Variables declaration - do not modify
private javax. swing.JButton addRunnerBtn;
private javax.swing.JLabel dataLabel; private
javax.swing.JButton deleteDataBtn; private j
avax. swing.JLabel j Labell • private j
avax.swing.JLabel jLabe12; private j avax.
swing.JLabel j Labe13 • private j avax.
swing.JPanel jPanel I • private j avax.
swing.JPanel jPane12 ; private j avax.
swing.JPanel jPane13 ; private j avax.
swing.JPanel jPane14; private j avax.
swing.JPanel j Pane15 ; private j avax.
swing.JPanel jPane16; private
javax.swing.JPanel jPane17; private j avax.
swing.JPanel jPane18; private j avax.
swing.JPanel jPane19 ; private j avax.
swing.JScrollPane j ScrollPane I • private j
avax. swing.JTable j Table I • private javax.
swing.JButton loadDataBtn; private
javax.swing.JLabel nameLabel; private
javax.swing.JTextField nameTxt; private
javax.swing.JLabel timeLabel; private
javax.swing.JTextField timeTxt; private
javax.swing.JButton viewWinnerBtn; // End
of variables declaration
Name Time Anus 100 goshi 110 Junaid
220 kala 18.0 Muhammad 110
Qazi 11.0

You might also like