汽车配件系统
应用介绍
此项目是Java中的汽车配件系统。Java中的Car Accessories System是一个用于管理汽车附件详细信息的项目。 整个系统在Netbeans IDE中。 该系统是基于管理员的系统。 系统支持此系统此处所需的所有功能。 它包括用于添加详细信息和详细信息面板以将记录保留在系统中的附件表格。谈到Java项目,该系统非常简单,而且非常用户友好。 用户可以通过汽车附件表格添加附件及其详细信息。 系统主体包括:一个表格,用于输入有关附件的详细信息并将数据添加到记录表中,并且记录详细信息以存储添加的信息。记录详细信息表顶部有两个搜索按钮:按价格搜索配件、next搜索具有选定类别的所有数据并显示。要运行此项目,您必须在PC上安装Eclipse IDE或Netbeans IDE。 安装完成后,下载项目并解压缩。 在Netbeans IDE中打开项目。 并简单地运行项目。 现在,在运行项目之前,请针对任何类型的错误和错误重建项目。 这将帮助您控制运行时错误代码。本人只展示了一小段代码,如想了解详情请下载附件。
package coursework;
import java.awt.Desktop;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
import javax.swing.table.DefaultTableModel;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Riya Nakarmi ,Sagar Parajuli, Prayag Joshi, Prabin Dura, Raj Kumar Gurung
*/
public class CAD_Info extends javax.swing.JFrame {
/**
* Creates new form CAD_Info
*/
//constructor of the class
public CAD_Info() {
initComponents();
setResizable(false);
setLocationRelativeTo(null);
}
/**
* 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.
*/
private int binarySearch(int[] a, int x) {
//Uses binary search algorithm to search the accessory items
Arrays.sort(a);
// System.out.println(Arrays.toString(a));
int size = a.length;
int lowIndex = 0;
int highIndex = size - 1;
while (lowIndex <= highIndex) {
int mid = (lowIndex +highIndex ) / 2;
if (a[mid] == x) {
return a[mid];
} else if (x > a[mid]) {
lowIndex = mid + 1;
} else {
highIndex = mid - 1;
}
}
return -1;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
jFileChooser = new javax.swing.JFileChooser();
bodyPanel = new javax.swing.JPanel();
jTabbedPane = new javax.swing.JTabbedPane();
detailsPanel = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
priceSrch = new javax.swing.JTextField();
priceSrchbtn = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
table = new javax.swing.JTable();
delItembtn = new javax.swing.JButton();
delAllbtn = new javax.swing.JButton();
categorySrch = new javax.swing.JComboBox<>();
catSrchbtn = new javax.swing.JButton();
formPanel = new javax.swing.JPanel();
mainFormPanel = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
idtf = new javax.swing.JTextField();
nametf = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
category = new javax.swing.JComboBox<>();
jLabel6 = new javax.swing.JLabel();
company = new javax.swing.JRadioButton();
community = new javax.swing.JRadioButton();
none = new javax.swing.JRadioButton();
jLabel7 = new javax.swing.JLabel();
high = new javax.swing.JRadioButton();
low = new javax.swing.JRadioButton();
medium = new javax.swing.JRadioButton();
jLabel8 = new javax.swing.JLabel();
pricetf = new javax.swing.JTextField();
addbtn = new javax.swing.JButton();
clearbtn = new javax.swing.JButton();
titlePanel = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jMenuBar = new javax.swing.JMenuBar();
menu = new javax.swing.JMenu();
open = new javax.swing.JCheckBoxMenuItem();
exit = new javax.swing.JCheckBoxMenuItem();
help = new javax.swing.JMenu();
helpmenu = new javax.swing.JCheckBoxMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
bodyPanel.setLayout(new javax.swing.OverlayLayout(bodyPanel));
jTabbedPane.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
detailsPanel.setBackground(new java.awt.Color(0, 102, 102));
jLabel1.setBackground(new java.awt.Color(0, 102, 153));
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 255, 255));
jLabel1.setText("Car Accessories Details");
priceSrch.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
priceSrchbtn.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
priceSrchbtn.setText("Search By Price");
priceSrchbtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
priceSrchbtnActionPerformed(evt);
}
});
table.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
table.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{ new Integer(1), "Bluetooth", "Media", "1000", "medium", "By Company"},
{ new Integer(2), "Air freshner", "Ambience", "1500", "medium", "None"},
{ new Integer(3), "Air bags", "Comfort", "13000", "high", "None"},
{ new Integer(4), "USB charger", "Media", "500", "low", "By Commmunity"},
{ new Integer(5), "Seat cover", "Interior", "6000", "high", "None"},
{ new Integer(6), "Floor mats", "Interior", "1000", "medium", "By Company"},
{ new Integer(7), "Sun roof", "Ambience", "3000", "medium", "By Company"},
{ new Integer(8), "Emergency supply", "Comfort", "1200", "medium", "None"},
{ new Integer(9), "Lighting", "Ambience", "1500", "medium", "None"},
{ new Integer(10), "Seat design", "Comfort", "10000", "high", "None"},
{ new Integer(11), "Armrest", "Comfort", "700", "low", "None"},
{ new Integer(12), "Mobile holder", "Interior", "650", "low", "None"}
},
new String [] {
"Accessory ID", "Accessory Name", "Category", "Price", "Price Range", "Recommendation"
}
) {
Class[] types = new Class [] {
java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.String.class, java.lang.String.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
table.setShowGrid(true);
table.setSurrendersFocusOnKeystroke(true);
jScrollPane1.setViewportView(table);
delItembtn.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
delItembtn.setText("Delete item");
delItembtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
delItembtnActionPerformed(evt);
}
});
delAllbtn.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
delAllbtn.setText("Delete all");
delAllbtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
delAllbtnActionPerformed(evt);
}
});
categorySrch.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
categorySrch.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Security ", "Comfort", "Ambience", "Media", "Interior" }));
categorySrch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
categorySrchActionPerformed(evt);
}
});
catSrchbtn.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
catSrchbtn.setText("Search By Category");
catSrchbtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
catSrchbtnActionPerformed(evt);
}
});
javax.swing.GroupLayout detailsPanelLayout = new javax.swing.GroupLayout(detailsPanel);
detailsPanel.setLayout(detailsPanelLayout);
detailsPanelLayout.setHorizontalGroup(
.........................................
..............................................
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: www_apollocode_net@163.com 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » 汽车配件系统
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
lib | 0.00 KB | 2019-11-18 |
unknown | 0.00 KB | 2019-11-18 |
binary | 0.00 KB | 2019-11-18 |
AbsoluteLayout | 0.00 KB | 2019-11-18 |
SNAPSHOT | 0.00 KB | 2019-11-18 |
AbsoluteLayout-SNAPSHOT.jar | 9.83 KB | 2019-11-18 |
pom.xml | 1.24 KB | 2019-11-18 |
src | 0.00 KB | 2019-11-16 |
main | 0.00 KB | 2019-11-42 |
java | 0.00 KB | 2020-01-32 |
com | 0.00 KB | 2019-11-42 |
mycompany | 0.00 KB | 2019-11-42 |
cad_is | 0.00 KB | 2019-11-42 |
coursework | 0.00 KB | 2020-01-24 |
CAD_Info.form | 53.77 KB | 2020-01-10 |
CAD_Info.java | 48.46 KB | 2020-01-10 |
test | 0.00 KB | 2019-11-16 |
java | 0.00 KB | 2019-11-16 |
target | 0.00 KB | 2020-01-06 |
CAD_IS-1.0-SNAPSHOT.jar | 25.43 KB | 2020-01-06 |
classes | 0.00 KB | 2020-01-04 |
coursework | 0.00 KB | 2020-01-20 |
CAD_Info$1.class | 0.72 KB | 2020-01-20 |
CAD_Info$10.class | 0.71 KB | 2020-01-20 |
CAD_Info$11.class | 0.71 KB | 2020-01-20 |
CAD_Info$12.class | 0.71 KB | 2020-01-20 |
CAD_Info$13.class | 0.72 KB | 2020-01-20 |
CAD_Info$14.class | 0.72 KB | 2020-01-20 |
CAD_Info$15.class | 0.72 KB | 2020-01-20 |
CAD_Info$16.class | 0.71 KB | 2020-01-20 |
CAD_Info$17.class | 0.71 KB | 2020-01-20 |
CAD_Info$18.class | 0.71 KB | 2020-01-20 |
发表评论 取消回复