1 / 15

GUI  AWT & SWING

GUI  AWT & SWING. Alpro-2. Target:. Mhs mampu memahami persamaan dan perbedaan antara AWT dan Swing Mhs tahu perbedaan antara komponen dan kontainer. Mhs mampu mendesain aplikasi GUI menggunakan AWT & SWING

zagiri
Télécharger la présentation

GUI  AWT & SWING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GUI AWT & SWING Alpro-2

  2. Target: • Mhs mampu memahami persamaan dan perbedaan antara AWT dan Swing • Mhs tahu perbedaan antara komponen dan kontainer. • Mhs mampu mendesain aplikasi GUI menggunakan AWT & SWING • Mhs mampu Menjelaskan tentang flow layout, border layout, dan grid layout dalam komponen GUI • Mhs bisa membuat tampilan yang komplek dalam mendesain aplikasi GUI

  3. Komponen GUI: • Abstract Windowing Toolkit (AWT) • Swing • Fungsi u/ mendesain dan mengimplementasikan aplikasi visual • The Java Foundation Class (JFC)bagian dari Java SDK u/ mengembangkan aplikasi JAVA GUI • JFC: • AWT • Swing • Java2D • Dimanakomponen AWT dapat digunakan bersama” komponen Swing

  4. Komponen GUI pada AWT: 1. Window Classes Fundamental

  5. Komponen GUI pada AWT: 1. Window Classes Fundamental • Mengatur ukuran windowmethod setSize void setSize(int width, int height) • Mengubah ukuran d/ width height sbg parameter: void setSize(Dimension d) • mengatur visibility=T void setVisible(boolean b) • Dalam mendesain aplikasi GUI, Object Frame selalu digunakan • Next AplikasiSampleFrame .java x ga jalan karena belum ada event handling

  6. Komponen GUI pada AWT: 2.Grafik • Method: GraphicPanel.java

  7. Komponen GUI pada AWT: 3.Kontrol User • FrameWControls .java

  8. Komponen GUI pada AWT: 4. Layout Manager • Fungsi mengatur tampilan dari komponen di dalam kontainer • Diantaranya: • FlowLayout • BorderLayout • GridLayout • Methodvoid setLayout(LayoutManager mgr) • u/ mengatur manual public void setBounds(int x, int y, int width, int height)

  9. FlowLayout Manager • d/ posisi argumen mengacu: • FlowLayout.LEFT • FlowLayout.CENTER • FlowLayout.RIGHT • FlowLayoutDemo.java

  10. BorderLayout Manager • d/ mengacu pada region: • BorderLayout.NORTH (utara) • BorderLayout.SOUTH (selatan) • BorderLayout.EAST (timur) • BorderLayout.WEST (barat) • BorderLayout.CENTER (tengah) • BorderLayoutDemo.java

  11. GridLayout Manager • komponen diposisikan dari: • kiri ke kanan • atas ke bawah • GridLayout manager membagi kontainer menjadi baris dan kolom • GridLayoutDemo.java

  12. Review AWT • ComplexLayout.java

  13. Komponen GUI pada Swing:

  14. Aplikasi • SwingDemo.java • JOptionPaneDemo.java

  15. Tugas???

More Related