1. Prefácio
Aprendi o idioma Java neste semestre. No final do semestre, escrevi um sistema de gerenciamento com uma interface de operação e associado ao banco de dados para consolidar o conhecimento que aprendi neste estudo.
Conhecimento usado: Java Basics, Java Interface Design (GUI), Oracle Database (precisa dominar as instruções de operação básica do banco de dados) e vincular o banco de dados.
Ferramentas de desenvolvimento usadas: Myeclipse Professional 2014
2. Design
Os atributos que gerenciamos são: número do projeto, nome do projeto, participante, pessoa responsável, horário de início do projeto e horário de término. O sistema de projetos de pesquisa científica possui quatro funções principais: a adição, exclusão, modificação e consulta de projetos de pesquisa científica. E o modo de login projetado para aumentar a segurança do sistema.
2.1 Adicionar: Adicione todas as informações sobre projetos de pesquisa científica à tabela no banco de dados
Depois de adicionar, use instruções SQL para pesquisar no console para verificar se ele foi adicionado ao banco de dados.
2.2 Consulta: Encontre todas as informações sobre o projeto por um número exclusivo do projeto
2.3 Modificação: selecione o projeto a ser modificado de acordo com o número do projeto e entre as informações do projeto para modificá-lo
2.4 Excluir: Exclua todas as informações do projeto correspondente por meio de um número de projeto exclusivo
3. Código fonte do formulário
3.1 Interface de login
Sistema de Gerenciamento de Informações sobre Pesquisa Científica do Pacote; Importar Java.awt.*; Importar java.awt.event.*; importar javax.swing. // Nome de usuário Tag Public Label Pwdlabel; // tag de senha Public TextField LGText; // Caixa de texto de nome de usuário Public TextField PWDText; // Caixa de texto de senha botão público lgbt; // botão de login Botão público QuitBt; // Botão de saída public LoginWindows () {super (); this.SetSize (400, 300); this.setTitle ("Sistema de Gerenciamento de Informações Científicas"); this.setLayout (nulo); Lglabel = new Label (); Lglabel.settext ("Conta de login:"); Lglabel.SetSize (60, 30); Lglabel.setLocation (70, 70); pwdlabel = new Label (); pwdlabel.settext ("senha:"); pwdlabel.setsize (60, 30); pwdlabel.setLocation (70, 150); LGText = new TextField (); LGText.SetSize (180, 30); lgtext.setLocation (140, 70); pwdText = new textfield (); pwdText.SetSize (180, 30); pwdText.setLocation (140, 150); LGBT = new Button (); lgbt.setlabel ("login"); LGBT.SetSize (60, 30); lgbt.setLocation (120, 220); QuitBt = new Button (); quitbt.setLabel ("Exit"); Quitbt.SetSize (60.30); quitbt.setLocation (220.220); quitbt.addactionListener (isto); lgbt.addactionListener (isto); this.addwindowlistener (isto); this.add (Lglabel); this.add (pwdlabel); this.add (LGText); this.add (LGBT); this.add (Quitbt); this.setVisible (true); } public static void main (string args []) {loginWindows main = new LoginWindows (); } @Override public void ActionPerformed (ActionEvent E) {Button bt = (Button) E.GetSource (); if (Bt.getLabel (). Equals ("Exit")) {System.exit (0); } else {if ((lgText.getText (). Equals ("")) || (pwdText.getText (). Equals ("" "))) {joptionPane.showMessAgedialog (esta," conta ou senha está vazia "); } else {if ((lgtext.getText (). Equals ("admin")) && (pwdText.getText (). Equals ("111"))) //if(lgText.getText (). Equals ("")) || // sqlwindow sql = new sqlwindow (); WindowsView w = new WindowsView (); w.sciencepro (); } else {JoptionPane.showMessagedialog (isto, "sem permissão"); }}}} @Override public void WindowOpened (WindowEvent e) {// TODO Método Auto-Gerado Busb} @Override public void WindowClosing (WindowEvent E) {// TODO Método Auto-Gerado Bus System.exit (0); } @Override public void Windowclosed (WindowEvent E) {// TODO Método Gerado automático Busb} @Override public void Windowiconified (WindowEvent E) {// TODO Método Auto-Generado Busb} @Override Public Void WindowDeiconized (WindoweVent E) {/ // ToDO AUTROUTIDOURIDE-GENERADO (WaildEdnized e) e) {// TODO Método Auto-Gerado Busb} @Override public void WindowDeActivated (WindowEvent E) {// TODO Método Auto-Generado Busb}}3.2 Código fonte do formulário principal
Pacote Sistema de Gerenciamento de Informações sobre Pesquisa Científica; importar javax.swing.*; importar java.awt.*; importar java.awt.event.*; importar javax.swing.event.*; importar javax.swing.tree.*; classe pública Windowsview implementos TreeSelectionListener, ActionListener // Classe de janela {jframe main; JPanel LeftPa; Jpanel uppa; JPanel Downpa; /// Consulta Control Jlabel numla; // Query jtextfield numtxt; JButton numbt; JTextfield Nametxt; // Mostra a caixa de texto que exibe o nome do projeto JTextfield Peopletxt; // Mostra o participante JTextfield PrinceLtxt; // Mostra a pessoa principal responsável JTextfield timestarttxt; // Mostra a caixa de texto que exibe o tempo de início JTextField timeEndtxt; // Mostra a caixa de texto que exibe o horário final esperado // Adicionar controle Jlabel Anumla; Jlabel Anamela; Jlabel Apelowlela; Jlabel Aprincipalla; Jlabel Atimestartla; Jlabel Atimeendla; Jtextfield anumtxt; JTextfield Anametxt; JTextfield APEOPLETXT; JTEXTFIELD APRINCIPALTXT; JTEXTFIELD ATIMESTARTTXT; JTextfield ATIMEENDTXT; JButton addbt; JTable ShowTable; // excluir controle jlabel dnumla; JButton Dnumbt; Jtextfield dnumtxt; // modifica o controle jlabel alnumla; Jtextfield allnumtxt; JButton Alsebt; Jlabel Allnumla; Jlabel Allnumla; Jlabel Alamela; Jlabel Alpeoplela; Jlabel Alprincipalla; Jlabel Altimestartla; Jlabel AlTimeendla; Jtextfield alnumtxt; Jtextfield alnametxt; JTEXTFIELD ALPEOPLETXT; JTEXTFIELD ALPRINCIPALTXT; JTextfield altimestarttxt; JTextField AlTimeEndtxt; public void SciencePro () {main = new jframe (); Main.SetSize (800.800); Main.Settitle ("Gerenciamento de informações de pesquisa científica"); main.setLayout (nulo); leftpa = new jpanel (); leftpa.setsize (150, 600); leftpa.setLocation (0, 0); leftpa.setBackground (color.white); initleftPanel (); main.add (leftPa); uppa = new jpanel (); uppa.setsize (650, 400); uppa.setLocation (150, 0); uppa.setBackground (color.gray); main.add (UPPA); Downpa = new JPanel (); Downpa.SetSize (650, 400); uppa.setBackground (color.gray); main.add (UPPA); Downpa = new JPanel (); Downpa.SetSize (650, 400); downpa.setLocation (150, 400); downpa.setBackground (color.orange); main.add (Downpa); main.setVisible (true); } private void initleftPanel () {string [] strs = {"query", "add", "delete", "modify"}; JTree Tree = New JTree (STRS); Tree.addtreeSelectionListener (isto); leftpa.add (árvore); } public void valuechanged (TreeSelectionEvent e) {JTree Tree = (JTree) E.GetSource (); DefaultMutableTreenode SelectionNode = (defaultMutableTreenode) Tree.getLastSelectedPathComponent (); String str = seleçãoNode.toString (); if (str.equals ("query")) {initUpdownPawHensearch (); } if (str.equals ("add")) {initupDownPawHenadd (); } if (str.equals ("delete")) {initupDownPawhendelete (); } if (str.equals ("modify")) {initupDownPawHenalert (); }} private void initupDownPawHensearch () {// clear uppa.removeall (); downpa.removeall (); // carrega dinamicamente os controles nos painéis superior e inferior uppa.setLayout (nulo); numla = new jlabel (); numla.Settext ("Por favor, digite o número do projeto"); Numla.setLocation (40, 60); Numla.SetSize (100, 40); numtxt = new JTextField (); numtxt.setLocation (180, 60); Numtxt.SetSize (200, 30); numbt = new jbutton (); numbt.settext ("consulta"); numbt.addactionListener (isto); numbt.setLocation (250, 160); numbt.SetSize (60, 30); uppa.add (numla); uppa.add (numtxt); uppa.add (numbt); uppa.validate (); uppa.Repaint (); numbt.addactionListener (isto); // Carregar dinamicamente o controle do painel nametxt = new jtextfield (); nametxt.setLocation (80, 50); nametxt.SetSize (300, 30); peopletxt = new jtextfield (); peopletxt.setLocation (80, 100); peopletxt.SetSize (300, 30); PrinceLtxt = new JTextField (); PrincipAltxt.SetLocation (80, 150); PrincipAltxt.SetSize (300, 30); timeSTartTxt = new JTextField (); TimeStarttxt.SetLocation (80, 200); timeSTartTxt.SetSize (300, 30); timeendtxt = new JTextfield (); timeendtxt.setLocation (80, 250); timeendtxt.SetSize (300, 30); downpa.setLayout (nulo); downpa.add (nametxt); downpa.add (peopletxt); downpa.add (PrincipAtxt); downpa.add (timeStarttxt); downpa.add (timeendtxt); downpa.validate (); Downpa.Repaint (); } public void ActionPerformed (ActionEvent E) {JButton bt = (JButton) E.GetSource (); //bt.addactionListener(This); if (bt.getText (). Equals ("query")) {if (numtxt.getText (). Equals ("" ")) {joptionpane.showMessagedialog (null," digite o número do projeto "); } else {OFENSEARCH DEENCIONAL = New DealSearch (); String INF = DEENCIDENTE.FindProbynum (Integer.ParseInt (numtxt.getText (). TRIM ())); if ((inf! = null) && (! inf.equals ("" ")))) {string [] strs = inf.split (", "); nametxt.settext (strs [1]); peopletxt.settext (strs [2]); PrincipAltxt.Settext (STRS [3]); timeStarttxt.Settext (STRS [4]); timeendtxt.settext (strs [5]); }}} if (bt.getText (). Equals ("new")) {se (anumtxt.getText (). Equals ("") || anametxt.getText (). Equals ("") || apeleOPletXt.getText (). Equals ("") || abrin CIPALTXT.GetText (). Equals ("") || ATIMESTARTTXT.GETTEXT (). Equals ("") || ATIMEENDTXT.GetText (). Equals ("")) {JoptionPane.showMessagedialog (null, "Não pode haver um valor nulo na entrada !!"); } else {ScienceProject s = new ScienceProject (); s.setNum (Integer.Parseint (Anumtxt.getText ())); s.setName (nametxt.getText ()); s.setPeople (APEOPletxt.getText ()); s.setLeader (APRIRIBALTXT.GetText ()); s.SetTimestart (atimestarttxt.getText ()); s.setTimeFinish (ATimeendtxt.getText ()); Dealadd Deal = New DealAdd (); Deal.Add (S); }} if (Bt.getText (). Equals ("Delete")) {if (Integer.parseint (dnumtxt.getText ()) == 0) {joptionpane.showMessagedialog (null, "não pode excluir o número do item vazio !!"); } else {DealDelete Deal = New DealDelete (); deal.Delete (Integer.Parseint (dnumtxt.getText (). TRIM ())); }} if (bt.getText (). Equals ("submit")) {if (Integer.parseint (allnumtxt.getText ())) == 0) {JoptionPane.showMessagedialog (nulo, "o número vazio do projeto não pode ser modificado !!"); } else {OFENSUB DEENCIMENTO = NEW DEENSUB (); deal.subMit (Integer.parseint (allnumtxt.getText ())); }} if (bt.getText (). Equals ("modify")) {se (alnametxt.getText (). Equals ("") || alpeOPletxt.getText (). Equals ("") || alprinciPaltxt.getText (). Equals ("")). JoptionPane.showMessagedialog (null, "Não pode haver um valor nulo na entrada !!"); } else {ScienceProject s = new ScienceProject (); s.setNum (Integer.Parseint (allnumtxt.getText ())); s.setName (alnametxt.getText ()); s.SetPeople (alpeOPletxt.getText ()); s.setLeader (alprinciPaltxt.getText ()); s.SetTimestart (altimestarttxt.getText ()); s.setTimeFinish (altimeendtxt.getText ()); Negociação de despedida = newenAlter (); Deal.alter (s); }}} private void initupDownPawHenadd () {// clear uppa.removeall (); downpa.removeall (); // carregamento dinâmico do painel superior uppa.setLayout (nulo); anumla = new jlabel (); Anumla.settext ("Por favor, insira o número do item a ser adicionado"); anumla.setLocation (30, 50); Anumla.SetSize (150, 40); anumtxt = new jtextfield (); Anumtxt.setLocation (200, 50); Anumtxt.SetSize (250, 30); anamela = new jlabel (); anamela.settext ("Por favor, insira o nome do projeto a ser adicionado"); anamela.setLocation (30, 100); Anamela.SetSize (150, 40); anametxt = new jtextfield (); anametxt.setLocation (200, 100); anametxt.setsize (250, 30); Apelowla = new Jlabel (); Apelela.settext ("Insira o participante do projeto"); apeeoplela.setLocation (30, 150); Apelela.SetSize (150, 40); ApeOPletXt = new JTextField (); ApeOPletxt.SetLocation (200, 150); ApeOPletXt.SetSize (250, 30); APRINCIPALLA = new Jlabel (); APRINCIPALLA.SETTEXT ("Por favor, digite o líder do projeto"); Aprincipalla.setLocation (30, 200); Aprincipalla.SetSize (150, 40); APRINCIPALTXT = new JTextField (); AprinciPaltxt.setLocation (200, 200); AprinciPaltxt.SetSize (250, 30); atimestartla = new jlabel (); ATIMESTARTLA.SETTEXT ("Por favor, digite o horário de início do projeto"); atimestartla.setLocation (30, 250); atimestartla.setsize (150, 40); ATIMESTARTTTXT = new JTextfield (); atimestarttxt.setLocation (200, 250); atimestarttxt.setsize (250, 30); atimeendla = new jlabel (); ATIMEENDLA.SETTEXT ("Por favor, digite o horário final do projeto"); atimeendla.setLocation (30, 300); atimeendla.setsize (150, 40); atimeendtxt = new jtextfield (); atimeendtxt.setLocation (200, 300); atimeendtxt.setsize (250, 30); addBt = new jbutton (); addbt.settext ("novo"); addbt.addactionListener (this); //addbt.addmouselistener( este); addbt.setLocation (250, 340); addbt.SetSize (60, 30); uppa.add (addbt); uppa.add (Anumla); uppa.add (Namela); uppa.add (apeeoplela); uppa.add (Aprincipalla); uppa.add (atimestartla); uppa.add (atimeendla); uppa.add (atimetxt); uppa.add (anumtxt); uppa.add (ApeOPletXt); uppa.add (APRinciPaltxt); uppa.add (atimestarttxt); uppa.add (atimeendtxt); uppa.validate (); uppa.Repaint (); downpa.validate (); Downpa.Repaint (); Downpa.Repaint (); } private void initupdownPawhendelete () {// limpo uppa.removeall (); downpa.removeall (); // carrega dinamicamente o controle do painel superior uppa.setLayout (nulo); numla = new jlabel (); numla.Settext ("Por favor, insira o número do item a ser excluído"); Numla.setLocation (40, 60); Numla.SetSize (150, 40); dnumtxt = new jtextfield (); dnumtxt.setLocation (200, 60); dnumtxt.SetSize (250, 30); dnumbt = new jbutton (); dnumbt.settext ("delete"); dnumbt.addactionListener (isto); dnumbt.setLocation (270, 170); Dnumbt.SetSize (60, 30); uppa.add (numla); uppa.add (dnumtxt); uppa.add (dnumbt); uppa.validate (); uppa.Repaint (); downpa.validate (); Downpa.Repaint (); } private void initupdownPawHenArt () {// limpe uppa.removeall () nos painéis superior e inferior; downpa.removeall (); // carrega dinamicamente o controle do painel superior uppa.setLayout (nulo); alnumla = new jlabel (); alnumla.settext ("insira o número do projeto a ser modificado"); alnumla.setLocation (40, 60); Alnumla.SetSize (150, 40); alsebt = new jbutton (); alsebt.settext ("submeter"); alsebt.addactionListener (isto); Alsebt.setLocation (270, 170); Alsebt.SetSize (60, 30); allnumtxt = new jtextfield (); allnumtxt.setLocation (200, 60); Allnumtxt.SetSize (200, 30); uppa.add (alnumla); uppa.add (Alsebt); uppa.add (allnumtxt); uppa.validate (); uppa.Repaint (); albt = novo jbutton (); albt.settext ("modify"); albt.addactionListener (isto); albt.setLocation (450, 170); Albt.SetSize (60, 30); /* allnumla = new jlabel (); allnumla.settext ("insira o número do projeto modificado"); allnumla.setLocation (30, 00); Allnumla.SetSize (150, 40); ALNUMTXT = new JTextField (); alnumtxt.setLocation (180, 00); alnumtxt.setsize (250, 30);*/ alamela = new jlabel (); ALNAMELA.SETEXT ("Por favor, digite o nome do projeto modificado"); alamela.setLocation (30, 50); alamela.SetSize (150, 40); alnametxt = new JTextfield (); alnametxt.setLocation (180, 50); alnametxt.SetSize (250, 30); alpeoplela = new jlabel (); alpeoplela.settext ("Redefina o participante"); alpeoplela.setLocation (30, 100); alpeoplela.setsize (150, 40); alpeOPletxt = new JTextfield (); alpeOPletxt.setLocation (180, 100); alpeOPletxt.SetSize (250, 30); alprincipalla = new jlabel (); alprincipalla.settext ("Redefina o líder do projeto"); alprincipalla.setLocation (30, 150); alprincipalla.setsize (150, 40); alprinciPaltxt = new jtextfield (); alprinciPaltxt.setLocation (180, 150); alprinciPaltxt.SetSize (250, 30); altimestartla = new jlabel (); altimestartla.settext ("Redefina o tempo de início do projeto"); altimestartla.setLocation (30, 200); altimestartla.setsize (150, 40); altimestarttxt = new jtextfield (); altimestarttxt.setLocation (180, 200); altimestarttxt.setsize (250, 30); altimeEndla = new Jlabel (); altimeendla.settext ("Redefina o horário de término do projeto"); altimeendla.setLocation (30, 250); AlTimendla.SetSize (150, 40); altimeEndtxt = new JTextField (); altimeendtxt.setLocation (180, 250); altimeendtxt.setsize (250, 30); downpa.add (albt); //downpa.add(allnumla); downpa.add (alamela); downpa.add (alpeoplela); downpa.add (Alprincipalla); downpa.add (altimestartla); downpa.add (AlTimeEndla); downpa.add (altimetxt); //downpa.add(alnumtxt); downpa.add (alpeOPletXt); downpa.add (alprinciPaltxt); downpa.add (altimestarttxt); downpa.add (AlTimeEndtxt); downpa.setLayout (nulo); downpa.validate (); Downpa.Repaint (); }}3.3 Organizar instruções SQL e vincular peças de banco de dados
Pacote Sistema de Gerenciamento de Informações sobre Pesquisa Científica; importar java.sql. String construc = "JDBC: Oracle: Thin: @localhost: 1521: xe"; Conexão con = driverManager.getConnection (Constr, "System", "1"); Stringbuffer sql = new StringBuffer ("Inserir na ciência valores ("+cientyProject.getnum ()+", '"+scienceProject.getName ()+"', '"+scienceProject.getpeople ()+"', '"+scienceproject.getLeader ()+"', '"+scienceproject.gettimart ()+' '', '" "" "," ")+", "" ScienceftrenTert); Declaração st = con.createstatement (); St.Execute (sql.toString ()); St.Close (); con.close (); } catch (Exceção e) {// TODO: lidar com excepção System.out.println (e.toString ()); }} public void delcienceProject (ScienceProject ScienceProject) {try {Class.ForName ("oracle.jdbc.driver.oracledriver"). NewInstance (); String construc = "JDBC: Oracle: Thin: @localhost: 1521: xe"; Conexão con = driverManager.getConnection (Constr, "System", "1"); StringBuffer sql = new StringBuffer ("Exclua da ciência onde num ="+scienceProject.getNum ()+""); Declaração st = con.createstatement (); St.Execute (sql.toString ()); St.Close (); con.close (); } catch (Exceção e) {// TODO: lidar com excepção System.out.println (e.toString ()); }} public void upDsCienceProject (ScienceProject ScienceProject) {try {Class.ForName ("oracle.jdbc.driver.oracledriver"). NewInstance (); String construc = "JDBC: Oracle: Thin: @localhost: 1521: xe"; Conexão con = driverManager.getConnection (Constr, "System", "1"); StringBuffer sql = new StringBuffer ("Atualizar conjunto de ciências name = '"+scienceProject.getName ()+"', workpeople = '"+scienceProject.getpeople ()+"', gerente = '"+scienceProject.getLeader ()+"', timeSTart = '"+sciencePoject.gettimeTart ()+",, timeEn = " num = "+ScienceProject.getNum ()+" "); Declaração st = con.createstatement (); St.Execute (sql.toString ()); St.Close (); con.close (); } catch (Exceção e) {// TODO: lidera o excepcionário System.out.println ("Modify Exception"); System.out.println (e.toString ()); }} public ScienceProject findBynum (int num) {ScienceProject ScienceProject = new ScienceProject (); tente {Class.ForName ("oracle.jdbc.driver.oracledriver"). NewInstance (); String construc = "JDBC: Oracle: Thin: @localhost: 1521: xe"; Conexão con = driverManager.getConnection (Constr, "System", "1"); StringBuffer sql = new StringBuffer ("Selecione * da ciência onde num ="+num+""); Declaração st = con.createstatement (); ResultSet rs = St.ExecuteQuery (sql.toString ()); while (rs.Next ()) {ScienceProject.Setnum (rs.getInt (1)); ScienceProject.SetName (Rs.getString (2)); ScienceProject.SetPeople (Rs.getString (3)); ScienceProject.SetLeader (Rs.getString (4)); ScienceProject.Settimestart (Rs.getString (5)); ScienceProject.SetTimeFinish (Rs.getString (6)); } St.Close (); con.close (); } catch (Exceção e) {// TODO: lidar com excepção System.out.println (e.toString ()); } Retornar ScienceProject; } public ScienceProject Look () {ScienceProject ScienceProject = new ScienceProject (); tente {Class.ForName ("oracle.jdbc.driver.oracledriver"). NewInstance (); String construc = "JDBC: Oracle: Thin: @localhost: 1521: xe"; Conexão con = driverManager.getConnection (Constr, "System", "1"); StringBuffer sql = new StringBuffer ("Selecione *da Science"); Declaração st = con.createstatement (); ResultSet rs = St.ExecuteQuery (sql.toString ()); while (rs.Next ()) {ScienceProject.Setnum (rs.getInt (1)); ScienceProject.SetName (Rs.getString (2)); ScienceProject.SetPeople (Rs.getString (3)); ScienceProject.SetLeader (Rs.getString (4)); ScienceProject.Settimestart (Rs.getString (5)); ScienceProject.SetTimeFinish (Rs.getString (6)); } St.Close (); con.close (); } catch (Exceção ex) {// TODO: lidar com excepção System.out.println (Ex.ToString ()); } Retornar ScienceProject; } public static void main (string args []) {}}3.4 Adicione, exclua, pesquise e modifique o código -fonte correspondente
// solucionar problemas da adição do Sistema de Gerenciamento de Informações sobre Pesquisa Científica do Pacote; importar javax.swing.JOptionPane; public class DealAdd {public DealAdd () {} public void Add (ScienceProject s) {sql sql = new sql (); if (sql.findbynum (s.getnum ()). getnum ()! = 0) {joptionpane.showMessagedialog (null, "Este projeto já existe, por favor, volte!"); } else {sql.addscienceProject (s); JoptionPane.showMessagedialog (null, "addSuccess"); }}} Como pode ser visto na parte do design, o número do projeto precisa ser enviado primeiro ao excluir, para que o evento de envio precisa ser processado.
// Processando o Sistema de Gerenciamento de Informações sobre Pesquisa Científica do Pacote de Submissão; importar javax.swing.JOptionPane; public class OalSub {OFENSUB () {} public void submit (int num) {sql sql = new sql (); if (sql.findbynum (num) .getnum () == 0) {joptionpane.showMessagedialog (null, "Este projeto não existe"); } else {JoptionPane.showMessagedialog (null, "Por favor, preencha as informações do projeto modificado abaixo"); }}} // Processando o sistema de gerenciamento de informações científicas de pesquisa científica; importar javax.swing.JOptionPane; public class DealDelete {public DealDelete () {} public void Delete (int num) {ScienceProject s = new ScienceProject (); Sql sql = new sql (); if (sql.findbynum (num) .getnum () == 0) {joptionPane.showMessagedialog (null, "o projeto não existe ~"); } else {s = sql.findbynum (num); sql.delscienceproject (s); JoptionPane.showMessagedialog (null, "Exclua com sucesso ~"); }}} // manipula e modifique o sistema de gerenciamento de informações científicas de pesquisa científica; importar javax.swing.JOptionPane; public class ReGealter {public deslealter () {} public void alter (ScienceProject s) {sql sql = new sql (); sql.UpdsCienceProject (s); JoptionPane.ShowMessagedialog (null, "Modificar com sucesso"); }} // manipula e consulta o sistema de gerenciamento de informações científicas de pesquisa científica; public class OalSearch // Handle and Query Events {public OalSearch () {} public String findProbynum (int num) // Query pelo número do projeto {String result = ""; ScienceProject s = new ScienceProject (); Sql sql = new sql (); s = sql.findbynum (num); resultado = s.getnum ()+","+s.getName ()+","+s.getpeople ()+","+s.getLeader ()+","+s.gettimestart ()+","+s.gettimefinish (); resultado de retorno; }}3.5 Janela de login de chamada de função principal
Pacote Sistema de Gerenciamento de Informações sobre Pesquisa Científica; public class Test {public static void main (string [] args) {LoginWindows v = new LoginWindows (); }}4. Resumo
Ainda existem alguns defeitos. Devido à falta de familiaridade com projetos de pesquisa científica, alguns atributos não são razoáveis e há muitas coisas que não foram consideradas. Além disso, o desconhecimento da GUI também limita nosso design na janela. Ele também precisa ser modificado em termos de propriedades do projeto e Windows.
O exposto acima é todo o conteúdo deste artigo. Espero que seja útil para o aprendizado de todos e espero que todos apoiem mais o wulin.com.