Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BeginScherm extends javax.swing.JFrame {
- /**
- * Creates new form secondWindow
- */
- public BeginScherm() {
- //DIT ZORGT ERVOOR DAT SCHERM IN MIDDEN KOMT TE STAAN
- initComponents();
- this.setLocationRelativeTo(null);
- //DIT ZORGT DAT JE DE METHODE VAN TIJD PAKT EN HIERIN ZET
- CurrentDate();
- //DIT ZORGT ERVOOR DAT JE DE "WELKOM, %USERNAME%" KAN GEBRUIKEN, DOOR DE USERNAME VAN VORIGE FRAME (LOGINSCHERM) TE GETTEN.
- String getValue=jLabel1.getText();
- jLabel1.setText(getValue+ (Loginscherm.jTextField1.getText()) + "!");
- }
- //DATUM EN TIJD LATEN ZIEN
- public void CurrentDate()
- {
- Thread clock=new Thread()
- {
- public void run()
- {
- for(;;)
- {
- Calendar cal=new GregorianCalendar();
- int month=cal.get(Calendar.MONTH);
- int year=cal.get(Calendar.YEAR);
- int day=cal.get(Calendar.DAY_OF_MONTH);
- //jLabel9 is de Label die de datum moet tonen
- jLabel9.setText(day+"/"+(month+1)+"/"+(year));
- int second=cal.get(Calendar.SECOND);
- int mint=cal.get(Calendar.MINUTE);
- int hour=cal.get(Calendar.HOUR);
- //jLabel10 is de Label die de tijd moet tonen
- jLabel10.setText((hour+12)+":"+(mint)+":"+(second));
- try {
- sleep(1000);
- } catch (InterruptedException ex) {
- // Logger.getLogger(Students_and_Teachers_Management.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- };
- clock.start();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement