Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //class studenci
- ArrayList<Student> lista = new ArrayList<Student>();
- public void wstaw(String imie, String nazwisko, int nrAlbumu){
- lista.add(new Student(imie,nazwisko,nrAlbumu));
- }
- public Student wyswietl(int i){
- Student napis;
- napis = lista.get(i);
- return napis;
- //JFrame
- private void nrAlbumuKeyReleased(java.awt.event.KeyEvent evt) { //analogicznie zrobione z imieniem i nazwiskiem
- nrAlbumuzm=Integer.parseInt(nrAlbumu.getText());
- }
- private void wykonajActionPerformed(java.awt.event.ActionEvent evt) {
- int ilosc=0;
- wyswietlanie.setText("");
- st.wstaw(imiezm,nazwiskozm,nrAlbumuzm);
- nrAlbumu.setText("");
- imie.setText("");
- nazwisko.setText("");
- String napis = String.valueOf(st.wyswietl(ilosc));
- wyswietlanie.setText(napis);
- ilosc++;
- }
- private void dodajActionPerformed(java.awt.event.ActionEvent evt) {
- nrAlbumu.setVisible(true);
- imie.setVisible(true);
- nazwisko.setVisible(true);
- nralbumulabel.setVisible(true);
- imielabel.setVisible(true);
- nazwiskolabel.setVisible(true);
- wykonaj.setVisible(true);
- clean.setVisible(true);
- }
- private void wyswietlActionPerformed(java.awt.event.ActionEvent evt) {
- nrAlbumu.setVisible(false);
- imie.setVisible(false);
- nazwisko.setVisible(false);
- nralbumulabel.setVisible(false);
- imielabel.setVisible(false);
- nazwiskolabel.setVisible(false);
- wykonaj.setVisible(false);
- clean.setVisible(false);
- for(int i=0;i<st.rozmiar;i++){ //rozmiar to zmienna przechowująca aktualny rozmiar listy
- String napis = String.valueOf(st.wyswietl(i));
- wyswietlanie.setText(napis);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement