0% found this document useful (0 votes)
37 views2 pages

Java Stock Management GUI App

This document contains the code for a Java GUI application that manages stock. The application contains panels, labels, buttons, text fields, checkboxes, radio buttons, tables and other GUI components to allow users to register, search and view reports on stocks.

Uploaded by

Amanuel Desalegn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Java Stock Management GUI App

This document contains the code for a Java GUI application that manages stock. The application contains panels, labels, buttons, text fields, checkboxes, radio buttons, tables and other GUI components to allow users to register, search and view reports on stocks.

Uploaded by

Amanuel Desalegn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/*

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.*;
public class StockMangementAPI extends JFrame {
private JTextField fn,ln,search;
private JPasswordField password;
private JComboBox country;
private JCheckBox cpp,java;
private JRadioButton male,female;
private ButtonGroup bg;
private JSpinner age;
private JButton save,Register,Report,searchbtn;
private JLabel logo1,logo2,title;
private JTable mytable;
JPanel panelnorth,panelsouth,panelwest,paneleast,panelcenter1,panelcenter2;
Connection conn;
ResultSet rs;
Statement stmnt;
public StockMangementAPI()
{
panelnorth=new JPanel(new FlowLayout(FlowLayout.CENTER, 15, 10));
logo1=new JLabel(new ImageIcon("F:\\Advanced Programming\\imagess\\
telelogo.jpeg"));
title=new JLabel("Stock Management System");
title.setFont(new Font("Times New Roman", Font.BOLD, 14));
logo2=new JLabel(new ImageIcon("F:\\Advanced Programming\\imagess\\
telelogo.jpeg"));
panelnorth.add(logo1);
panelnorth.add(title);
panelnorth.add(logo2);
panelwest=new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 10));
Register=new JButton("Register");
Register.setFont(new Font("Times New Roman", Font.BOLD, 14));
Report=new JButton("Report");
Report.setFont(new Font("Times New Roman", Font.BOLD,14));
panelwest.add(Register);
panelwest.add(Report);
panelwest.add();
panelwest.add(Report);

paneleast=new JPanel();
panelsouth=new JPanel();
panelcenter1=new JPanel(new GridLayout(11, 1, 10, 5));
fn=new JTextField(10);
ln=new JTextField(10);
String list[]={"Ethiopia", "Eriteria"};
country=new JComboBox(list);
cpp=new JCheckBox("C++");
java=new JCheckBox("Java");
password=new JPasswordField(10);
bg=new ButtonGroup();
male=new JRadioButton("Male");
female=new JRadioButton("Female");
bg.add(male);
bg.add(female);
SpinnerModel value = new SpinnerNumberModel(5, //initial value
0, //minimum value
10, //maximum value
1); //step
age=new JSpinner(value);
save=new JButton("Save");
panelcenter1.add(fn);
panelcenter1.add(ln);
panelcenter1.add(country);
panelcenter1.add(cpp);
panelcenter1.add(java);
panelcenter1.add(password);
panelcenter1.add(male);
panelcenter1.add(female);
panelcenter1.add(age);
panelcenter1.add(save);

panelcenter2=new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 15));


search=new JTextField(20);
searchbtn=new JButton("Search");
mytable=new JTable(3, 3);
panelcenter2.add(search);
panelcenter2.add(searchbtn);
panelcenter2.add(mytable);
panelcenter2.setVisible(false);

setSize(600, 600);
setLayout(new BorderLayout(10,5));
setVisible(true);
add(panelnorth,BorderLayout.NORTH);
add(panelsouth, BorderLayout.SOUTH);
add(panelwest,BorderLayout.WEST);
add(paneleast,BorderLayout.EAST);
add(panelcenter1, BorderLayout.CENTER);
add(panelcenter2,BorderLayout.CENTER);

}
public static void main(String[] args) {
StockMangementAPI obj=new StockMangementAPI();
}
}

*/

You might also like