Os exemplos deste artigo compartilham com você o código específico de implementação Java do sistema de gerenciamento de estudantes para sua referência. O conteúdo específico é o seguinte
pacote bookdemo_1; importar javax.swing.*; importar java.awt.*; importar java.awt.event.*; Public class Test {public static void main (String [] args) {Studentys STUSYS = New Studentys ("Sistema de Gerenciamento de Estudantes"); STUSYS.initwin (); }} Classe Studentys estende JFrame {private JPanel P1, P2, P3, Combop; guia privada jtabbedpane; Contêiner de contêiner privado; Private JButton B1, B2; ouvinte privado ouvinte; Rótulo Privado Namelabel; gradelabel de marca própria; Showlabel de marca própria; Private JTextField TextName; Private JTextField TextGrade; textarea privada showgradarea; / * * Encontre * */ rótulo privado Searchlabel; Private JTextfield SearchText; Private JButton Sbut; Private JTextField ResultText; String privada [] nome; String privada [] grau; / * * Classificação * */ private textarea showtextarea; JButton privado Sortbut; private int contingnum = 0; private JButton Clearbut; Public Studentsys (String str) {super (str); this.name = new String [100]; this.Grade = new String [100]; ouvinte = novo ouvinte (); tab = new jtabbedpane (jtabbedpane.top); // contêiner de contêiner = this.getLayeredPane (); // Painel de objeto ComboP = new JPanel (); p1 = novo jpanel (); p2 = novo jpanel (); p3 = novo jpanel (); b1 = novo jbutton ("Confirmar add"); b2 = novo jbutton ("retrair add"); namelabel = new Label ("nome"); gradelabel = new Label ("pontuação"); showLabel = new Label ("O registro atual é zero!"); textName = new JTextfield (15); textGrade = new JTextfield (15); showgradarea = new textarea (); / * * Search * */ searchlabel = new Label ("Por favor, digite um nome:"); SearchText = new JTextfield (15); sbut = new jbutton ("Confirmar pesquisa"); ResultText = novo JTextfield (15); / * * Classificação * */ showTextarea = new textarea (); Sortbut = new JButton ("classificação"); clearBut = novo jbutton ("dados claros"); } public void initwin () {this.setBounds (300, 300, 500, 400); this.addwindowlistener (new windowAdapter () {public void windowclosing (windowEvent e) {super.windowclosing (e); system.exit (0);}}); layoutwin (); this.setVisible (true); } private void layoutwin () {tab.add (P1, "Score Input"); tab.add (P2, "Score Query"); tab.add (p3, "classificação de pontuação"); Combop.add (New Jlabel ("Sistema de Gerenciamento de Informações para Estudantes")); container.setLayout (new BorderLayout ()); container.add (Combop, borderlayout.north); container.add (tab, borderlayout.center); Contêiner con1 = new container (); con1.setLayout (new FlowLayout ()); con1.add (namelabel); CON1.Add (TextName); CON1.Add (Gradelabel); con1.add (textgrade); p1.add (con1, borderlayout.north); P1.Add (CON1); P1.Add (ShowGradarea); Contêiner con2 = new container (); CON2.SETLAYOUT (new FlowLayout ()); CON2.Add (B1); CON2.Add (B2); CON2.Add (Showlabel); P1.Add (CON2); B1.AddactionListener (ouvinte); b2.addactionListener (ouvinte); / * * Encontre layout * */ contêiner con3 = new container (); CON3.SETLAYOUT (new FlowLayout ()); CON3.Add (Searchlabel); CON3.Add (SearchText); CON3.Add (sbut); p2.add (con3, borderlayout.north); sbut.addactionListener (ouvinte); p2.add (resultText); / * * Classificar layout * */ p3.add (showTexTarea); P3.Add (Sortbut); p3.add (clearbut); sortbut.addactionListener (ouvinte); clearbut.addactionListener (ouvinte); } / * * A classe interna java implementa a interface ActionListener * * * / classe ouvinte implementa o ActionListener {@Override public void ActionPerformed (ActionEvent e) {if (e.getSource ()) == {if (textName.getText (). Equals (")) || (text.Text.Text (). showlabel.settext ("Adicionar falhado (nome, grau não pode estar disponível)!"); } else {name [countnum] = textName.getText (); Grade [countNum] = textGrade.getText (); countnum ++; String Area = "Adicione com sucesso, existem atualmente"+countNum+"Records; ShowLabel.Settext (Area); SortMess (false); TextName.Settext (" "); TextGrade.Settext (" "); shemsnum; registros; showlabel.settext (área); sortmess (false); }} if (e.getSource () == sbut) {if (! SearchText.getText (). Equals ("")) {searchMess (searchText.getText ()); }} if (e.getSource () == SortBut) {sortMess (true); } if (e.getSource () == clearBut) {if (! showtextarea.getText (). Equals ("")) {showtextarea.settext (""); }}} public void SortMess (sinal booleano) {// TODO Método Gerado Auto-Goldado if (signo) {for (int i = 0; i <countnum; i ++) {for (int j = i+1; j <countnum; j ++) {if (Integer.Parsent (GRADE [i]) s1 = nome [i]; s2 = grau [i]; nome [i] = nome [j]; grau [i] = grau [j]; nome [j] = s1; grau [j] = s2; }}}}} else {if (! showgradarea.getText (). Equals ("")) {showgradarea.settext (""); }} para (int i = 0; i <countnum; i ++) {string content = "nome:"+nome [i]+"/t"+"score"+grau [i]; if (signo) showtextarea.append (content+"/n"); else showgradarea.append (content+"/n"); }} public void SearchMess (String n) {// TODO Method Auto-Gerated Method Stub for (int i = 0; i <countnum; i ++) {if (nome [i] .equals (n)) {string content = "nome:"+nome [i]+","+"" "+grau [i]; ResultText.Settext (Content); retornar; }} ResultText.Settext ("Este aluno não foi encontrado!"); }}}}Para mais materiais de aprendizagem, preste atenção ao tópico especial "Desenvolvimento do Sistema de Gerenciamento".
O exposto acima é tudo sobre este artigo, espero que seja útil para todos aprenderem a programação Java.