Java 1.8 Swing with Eclipse Neon Index

Similar documents
Java 11 Swing with Eclipse Index

Java 11 Swing Index. Section Title Page

Java 1.9 Swing Index

Java 1.8 Swing with Eclipse Oxygen Index

Java 1.8 Swing with Eclipse Mars Index

Swing UI. Powered by Pentalog. by Vlad Costel Ungureanu for Learn Stuff

Handout 14 Graphical User Interface (GUI) with Swing, Event Handling

Chapter 12 GUI Basics

Summary Chapter 25 GUI Components: Part 2

Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p.

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI

Chapter 6: Graphical User Interfaces

Java IDE Programming-I

Part 3: Graphical User Interface (GUI) & Java Applets

Introduction to the JAVA UI classes Advanced HCI IAT351

Java Programming with Eclipse

Chapter 13 GUI Basics. Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved.

Swing. By Iqtidar Ali

CSE 331. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

Chapter 12 GUI Basics. Motivations. The design of the API for Java GUI programming

Java 1.8 Programming

Tool Kits, Swing. Overview. SMD158 Interactive Systems Spring Tool Kits in the Abstract. An overview of Swing/AWT

Java: Graphical User Interfaces (GUI)

CSE 331. Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT

CS111: PROGRAMMING LANGUAGE II

Programming graphics

Java Graphical User Interfaces

Packages: Putting Classes Together

Starting Out with Java: From Control Structures Through Objects Sixth Edition

Lecture 18 Java Graphics and GUIs

Chapter 12 Advanced GUIs and Graphics

CSE 1325 Project Description

John Zukowski's Definitive Guide to Swing for Java 2

Introduction to Graphical Interface Programming in Java. Introduction to AWT and Swing

Learn Java Programming, Dr.Hashamdar. Getting Started with GUI Programming

CSE 331 Software Design & Implementation

user-friendly and easy to use.

Contents Introduction 1

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).

JBuilder 8.0 JFC and Swing Programming

Supporting Materials

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13

JTcl and Swank. Bruce A. Johnson, Tom Poindexter, & Dan Bodoh. What s new with Tcl and Tk on the JVM. Wednesday, October 26, 11

CS 251 Intermediate Programming GUIs: Components and Layout

Graphical User Interfaces. Comp 152

Rizvi College of Arts, Science & Commerce Bandra (W), Mumbai Teaching Plan Academic Year

Certified Eclipse Bundle

Certified Eclipse Bundle

CS410G: GUI Programming. The Model/View/Controller Pattern. Model. Controller. View. MVC is a popular architecture for building GUIs

Advanced Java Programming. Swing. Introduction to Swing. Swing libraries. Eran Werner, Tel-Aviv University Summer, 2005

Java Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming

Table of Contents. Chapter 1 Getting Started with Java SE 7 1. Chapter 2 Exploring Class Members in Java 15. iii. Introduction of Java SE 7...

Announcements. Introduction. Lecture 18 Java Graphics and GUIs. Announcements. CSE 331 Software Design and Implementation

Containers and Components

Swing. Component overview. Java UI, summer semester 2017/2018 1

JFormDesigner 6 Documentation

1.1 GUI. JFrame. import java.awt.*; import javax.swing.*; public class XXX extends JFrame { public XXX() { // XXX. init() main() public static

Graphical User Interface (GUI)

All the Swing components start with J. The hierarchy diagram is shown below. JComponent is the base class.

China Jiliang University Java. Programming in Java. Java Swing Programming. Java Web Applications, Helmut Dispert

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

Index SELF-STUDY. Symbols

Graphics programming. COM6516 Object Oriented Programming and Design Adam Funk (originally Kirill Bogdanov & Mark Stevenson)

Reports 9i. Section Title Page

core 2 Basic Swing GUI Controls in Java 2

core programming Basic Swing GUI Controls in Java Marty Hall, Larry Brown

Contents Chapter 1 Introduction to Programming and the Java Language

PIC 20A GUI with swing

2010 가을학기부산대학교정보컴퓨터공학부 OVERVIEW OF GUI PROGRAMMING

2110: GUIS: Graphical User Interfaces

Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008

Course Status Networking GUI Wrap-up. CS Java. Introduction to Java. Andy Mroczkowski

More Swing. Chapter 14. Chapter 14 1

Chapter 14. More Swing

11/27/2007 TOPICS CHAPTER TOPICS LISTS READ ONLY TEXT FIELDS. Advanced GUI Applications. This module discusses the following main topics:

BASICS OF GRAPHICAL APPS

CSE 331 Software Design & Implementation

Summary. Section 14.1 Introduction. Section 14.2 Java s New Nimbus Look-and-Feel. 618 Chapter 14 GUI Components: Part 1

Window Interfaces Using Swing Objects

14.2 Java s New Nimbus Look-and-Feel 551 Sample GUI: The SwingSet3 Demo Application As an example of a GUI, consider Fig. 14.1, which shows the SwingS

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1

Chapter 6: Swing and Multimedia

Object Oriented Programming

8/23/2014. Chapter Topics. Chapter Topics. Lists. Read Only Text Fields. Chapter 13: Advanced GUI Applications

Java Swing. Lists Trees Tables Styled Text Components Progress Indicators Component Organizers

1. Swing Note: Most of the stuff stolen from or from the jdk documentation. Most programs are modified or written by me. This section explains the

Basicsof. JavaGUI and SWING

Chapter 7: A First Look at GUI Applications

SD Module-1 Advanced JAVA

SD Module-1 Advanced JAVA. Assignment No. 4

Object-Oriented Programming Design. Topic : User Interface Components with Swing GUI Part III

Swing/GUI Cheat Sheet

Unit 6: Graphical User Interface

Graphic User Interfaces. - GUI concepts - Swing - AWT

SELF-STUDY. Glossary

Is image everything?

Page 1 of 7. public class EmployeeAryAppletEx extends JApplet

Transcription:

One Introduction to Java 1 Usage of Java 2 Structure of Java 4 Flexibility of Java Programming 5 Using the Eclipse software 6 Swing and AWT in Java 7 Two Running Java in Eclipse 10 Introduction 11 Using Eclipse 12 Workspace Launcher 14 Workspace in Eclipse 19 Projects in Eclipse 20 Opening Projects in Eclipse 21 Importing Projects in Eclipse 22 Running Projects in Eclipse 27 Viewing results in the Eclipse Console 28 The Eclipse Console properties 30 Three Setting up a machine to use Eclipse 31 Introduction 32 Downloading the JDK 33 Installing the Java Developer Kit 36 Downloading Eclipse 40 Installing Eclipse 42 Four First Steps in Eclipse 44 Naming Java modules 45 Commenting in Java Programs 46 Editing Java in Eclipse 47 The SRC folder 49 Editing the code in the SRC 51 Examining the Workspace Folder 53 Examining the Workspace 54 Five Creating Projects and Classes in Eclipse 56 Introduction 57 Creating Projects 58 Importing Projects 62 Importing Projects from other Folders 63 Importing Archives into Workspace 66 Exporting a Project 69 Deleting Projects 73 Creating Packages 74 Creating Classes 77 Exporting Classes into Projects 82 Importing Classes into Projects 83 Copying Classes 86 Incorporating Existing Classes 88 Six Using the Java Editor in Eclipse 89 Introduction 90 Folding 92 OC05 Page 1 of 11 Seer Computing Ltd

Line Numbers 94 Creating Bookmarks 95 Using Bookmarks 96 Using Tasks 100 Correcting Errors 105 Error Checking 106 Colour Coding 108 Hints while typing 109 Bracket Location 111 Seven Dialog Boxes 112 Using Dialog Boxes 113 Using Message Dialogs 115 Using ImageIcons with Message Dialogs 120 Using Confirm Dialogs 123 Using Input Dialogs 128 Using Input Dialogs with Icons and Lists 130 Using Option Dialogs 132 Making a Beep in Java 138 Exercise One 139 Eight Dimensions 144 The Dimension Datatype 145 Examples of Using Dimensions 146 Methods for Dimensions 147 getscreensize() 149 Nine JFrame 150 Using JFrame 151 setdefaultcloseoperation() 152 setvisible() 153 Exiting JFrames 154 setresizable() 155 setlocation() 156 setbounds() 158 Centering JFrames 159 JFrame Example 160 setlocationrelativeto() for Centreing 161 dispose() 162 Using seticonimage() 163 Using Constructors in Java Swing 164 serialversionuid 165 Creating a Constructor Method 166 JFrame Constructor 168 @SuppressWarnings 169 Exercise Two 174 Ten JComponent 176 Introduction 177 Methods to Change Appearance 178 Methods to Process Components 182 Eleven Colour and Fonts 186 OC05 Page 2 of 11 Seer Computing Ltd

Using Color 187 Using Color with JFrame 189 Using Font 190 Twelve JLabel 196 Using JLabel 197 getcontentpane().add() 198 Creating a message in JLabel 200 Using HTML with JLabel 201 Changing the position in a JLabel 204 Adding an Icon to a JLabel 206 Changing a JLabel s Colour and Font 208 Icon only JLabel 210 setverticalalignment() 211 pack() 212 Exercise Three 214 Thirteen Borders 217 BorderFactory 218 createemptyborder() 221 createlineborder() 222 createraisedbevelborder() 224 createraisedsoftbevelborder() 225 createbevelborder() 226 createdashedborder() 228 createstrokeborder() 231 createetchedborder() 235 creatematteborder() 237 createtitledborder() 239 Nested createtitledborder() 249 Fonts with createtitledborder() 250 createcompoundborder() 251 Exercise Four 254 Fourteen Mid-Level Containers 258 Containers 259 JPanels 261 JScrollPanes 263 Scroll Bar policy 266 Exercise Five 268 Fifteen Absolute Layouts 270 Introduction 271 setbounds() 272 Exercise Six 276 Sixteen Layouts 277 JPanel and Layouts 278 FlowLayout 280 Some FlowLayout Methods 284 GridLayout 286 Some GridLayout Methods 291 BorderLayout 292 OC05 Page 3 of 11 Seer Computing Ltd

Defining BorderLayouts since Java 1.4 297 Some BorderLayout Methods 299 Exercise Seven 300 BoxLayout 303 SpringLayout 306 putconstraint() 310 Seventeen Box 314 Introduction 315 createrigidarea() 317 createverticalstrut() 318 createhorizontalstrut() 319 createglue() 320 createhorizontalglue() / createverticalglue() 322 Using Box.Filler 323 Using Box as a Container 326 Exercise Eight 328 Eighteen JButton 330 Introduction 331 Example 332 Using Insets to re-size JButtons 334 Using Icons with JButtons 336 Using AbstractButton with JButtons 337 Using SwingConstants with JButtons 341 Some Methods for JButtons 342 Using HTML with JButton 345 Advanced Icons with JButtons 346 Using Rollover with JButtons 348 JButtons and ToolTips 349 BasicArrowButton 350 Nineteen Event Handling with Listeners 352 Listening for Events 353 Twenty Private Event Listeners for JButtons 358 Introduction 359 java.awt.event.* 360 Example of Private Listener 361 ActionEvent 363 Recording the Event 364 Which Component fired the Listener 365 Using getactioncommand() 366 getvalueisadjusting() 367 getwhen() 368 Exercise Nine 369 Twenty One Public Event Listeners 371 Introduction 372 Example of Public Listener 373 Twenty Two Implemented Event Listeners 375 Introduction 376 Example of Implemented Listener 377 OC05 Page 4 of 11 Seer Computing Ltd

Twenty Three Listener Events 379 Introduction 380 Multiple Events with Listeners 381 Exercise Ten 384 Twenty Four JTextComponent 386 Methods in JTextComponent 387 Twenty Five Input Components 388 Introduction 389 JTextField 390 JTextField Example 391 JTextField Initialisation 393 Other Methods for JTextField 394 Processing JTextField using gettext() 396 Listeners for JTextField 397 FocusListener with JTextField 398 ActionListener with JTextField 400 JPasswordField 403 JPasswordField Example 404 setechochar() 406 JTextArea 407 JTextArea Example 408 JTextArea and setfocusable() 410 Wrapping text in JTextArea 412 Listeners with JTextArea 415 Some methods for JTextArea 416 JFormattedTextField 419 Initialising JFormattedTextField 420 Populating JFormattedTextField 423 Using setvalue() 425 Listeners with JFormattedTextField 426 Using MaskFormatter 427 Using setfocuslostbehavior 429 requestfocusinwindow() 431 Exercise Eleven 432 Twenty Six GroupLayout 434 Introduction 435 Sequential and Parallel Groups 436 addgap() 439 setautocreategaps() 440 Changing Direction of Components 441 Chained Invocation or Method Chaining 442 Adding further Groups with addgroup() 443 Controlling Resizing with addcomponent() 448 Using LinkSize to standardise sizing 451 Alignment 452 Twenty Seven Selection Components 453 JComboBox 454 Using additem() with JComboBox 457 OC05 Page 5 of 11 Seer Computing Ltd

getselecteditem() with JComboBox 458 ComboBoxModel with JComboBox 459 Some methods for JComboBox 460 ItemListener with JComboBox 462 JCheckBox 463 JCheckBox Example 464 Initialising JCheckBox 465 Using HTML with JCheckBox 466 Images with JCheckBox 467 ItemListener with JCheckBox 468 JToggleButton 470 Initialising JToggleButton 471 Listeners with JToggleButtons 472 JRadioButton 473 JRadioButton Example 475 Initialising JRadionButtons 477 Icons with JRadioButtons 478 ActionListener with JRadioButton 480 Using setactioncommand() 481 setactioncommand() Example 482 Using Enumeration 484 Using AbstractButton 487 Exercise Twelve 488 JList 493 JList Example 494 setlayoutorientation() with JList 496 setselectionmode() with JList 498 setprototypecellvalue() with JList 500 setfixedcellwidth with JList 501 DefaultListModel with JList 502 DefaultListModel Example 503 Icons with DefaultListModels 505 Using Vectors 507 Methods for Vectors 508 getselectedindices() in JList 513 JList Listeners 514 ListSelectionListener 515 Using getselectedvalueslist() 516 ListDataListener 517 ListDataListener Example 518 Exercise Thirteen 520 JSpinner 523 SpinnerNumberModel 524 SpinnerNumberModel Example 525 Methods for SpinnerNumberModel 526 Change Orientation of JSpinner 527 ChangeListener with JSpinner 528 SpinnerListModel 529 OC05 Page 6 of 11 Seer Computing Ltd

SpinnerListModel Example 530 setpreferredsize() 531 ArrayLists with SpinnerListModel 533 SpinnerDateModel 534 SpinnerDateModel Example 536 DateEditor with SpinnerDateModel 538 JSlider 543 Initialising JSlider 544 ChangeListener with JSlider 546 Placing Numbers on the JSlider 547 Placing ticking on the JSlider 548 setminortickspacing() with JSlider 549 Customising the JSlider ticks 550 Some more JSlider methods 551 JSeparator 553 JSeparator Example 554 Using Box with JSeparator Example 556 Exercise Fourteen 558 Twenty Eight JMenus and JPopupMenus 561 Introduction 562 JMenuBar 563 JMenuBar Example 565 JMenu 566 JMenu Example 567 JMenuBar and JTextField 568 Mnemonic with JMenus 569 MenuListener 570 MenuListener Example 571 JMenuItem 573 JMenuItem Example 574 JMenuItems with Images 575 Mnemonic with JMenuItems 576 Accelerator with JMenuItems 577 Listeners with JMenuItems 579 JMenuItem and MenuKeyListener 580 Sub-Menus in JMenus 581 JCheckBoxMenuItems in JMenus 582 JCheckBoxMenuItems with Images 584 JCheckBoxMenuItems with ItemListner 585 JRadioButtonMenuItem in JMenus 586 JRadioButtonMenuItem Example 587 JRadioButtonMenuItem with JMenu Example 588 JRadioButtonMenuItem with Images 589 JRadioButtonMenuItem and Listeners 590 Using getactioncommand() with JRadioButton 591 Using Enumeration 592 JPopupMenu 593 JPopupMenu with MouseListener 594 OC05 Page 7 of 11 Seer Computing Ltd

MouseListener Examples 595 Event.isPopupTrigger() 597 PopupMenuListener 598 JToolBar 599 JToolBar Example 601 JToolBar and setfloatable() 603 JToolBar and Listeners 604 JToolBar and Icons 605 JToolBar Orientation 606 JToolBar with JTextFields 607 addseparator() with JToolBar 609 Exercise Fifteen 610 Twenty Nine Applets 613 Introduction to using Applets within Eclipse 614 Using Appletviewer in Eclipse 615 Appletviewer Options 617 Converting a basic Application to an Applet 618 InvocationTargetException and Images 624 Using URL with Images 625 Dialog Boxes converted to JApplet 626 JInternalFrames (with LAF) converted to JApplet 627 JMenus converted to JApplet 628 JTrees converted to JApplet 629 JColorChooser converted to JApplet 630 Choosing Applet or Application in Eclipse 631 Using start(), stop(), paint(), init() and destroy() 637 Passing Parameters to JApplet in Eclipse 640 Using getparameter() with JApplet 643 Embedding Java in HTML 645 Using the <applet> tag in HTML 646 Using showstatus() (Short status strings) 648 Passing Parameters to the Applet 649 Reading Parameters in the Applet 650 Using the <object> tag in HTML 651 Accessing System Properties in Applets 652 Exercise Sixteen 654 Thirty Look and Feel (LAF) 657 Using setlookandfeel() 658 Standard LAF Styles 660 javax.swing.plaf.metal.metallookandfeel 662 javax.swing.plaf.nimbus.nimbuslookandfeel 663 com.sun.java.swing.plaf.motif.motiflookandfeel 664 com.sun.java.swing.plaf.windows.windowslookandfeel 665 com.sun.java.swing.plaf.windows.windowsclassiclookandfeel 666 Defaulting the LAF permanently in Java 667 Using Third Party LAFs 668 Installing the LAF in the Operating System 669 Identifying the Look and Feel Class in the Jar file 670 OC05 Page 8 of 11 Seer Computing Ltd

Using the third party LAF in Java 671 Exercise Seventeen 672 Thirty One GridBagLayouts 673 Introduction 674 GridBagConstraints 675 GridBagConstraints Example 678 gridx and gridy 683 gridx and gridy example 684 gridwidth and gridheight 687 gridwidth and gridheight example 688 GridBagConstraints.REMAINDER 691 fill 692 fill example 693 anchor 694 anchor examples 695 insets 697 insets example 698 ipadx and ipady 699 ipadx and ipady example 700 weightx and weighty 701 Final example 705 Thirty Two JTable 711 Introduction 712 JTable Example 713 Default Settings 716 setpreferredscrollableviewportsize() 717 java.lang.arrayindexoutofboundsexception 718 Problems with the TableColumnModel 719 Adding to a JPanel 720 Using DefaultTableModel() 721 Using addcolumn() 722 setautocreatecolumnsfrommodel() 724 Changing the Width of Columns 725 setresizable() 727 Some Methods for JTable 728 Moving Columns Programmatically 729 Moving Rows Programmatically 730 Setting the Selection Mode 731 iscelleditable() 734 Accessing Cells 736 Determining the Current Cell 737 ListSelectionListener 738 ListSelectionListener Example 739 TableModelListener 743 TableModelListener Example 745 Exercise Eighteen 748 Thirty Three Mouse Double Click 751 Introduction 752 OC05 Page 9 of 11 Seer Computing Ltd

Double Click Example 753 Thirty Four JTree 755 Introduction 756 JTree Example 757 Populating a JTree (Top to Bottom) 759 Expand() 762 Populating a JTree (Bottom to Top) 763 Populating a JTree with more levels 764 TreeExpansionListener 766 getlastselectedpathcomponent() 767 TreeSelectionListener 768 Customising the JTree 769 Thirty Five CardLayouts 771 Introduction 772 CardLayout Example 773 Exercise Nineteen 777 Thirty Six More Containers 782 Introduction 783 JSplitPane 784 setdividerlocation() with JSplitPane 788 Using setresizeweight with JSplitPane 789 JSplitPanes within JSplitPanes 790 JTabbedPane 792 JTabbedPane Example 794 Using addtab() with JTabbedPane 796 Inserting Tabs into a JTabbedPane 799 Removing Tabs in JTabbedPane 800 Positioning the Tabs 801 settablayoutpolicy for JTabbedPane 804 setmnemonic() with Tabs 806 Some Methods for JTabbedPane 807 ChangeListener with JTabbedPane 811 Thirty Seven More Frames 813 JInternalFrame 814 Using LAF with JInternalFrame 816 JInternalFrame Behaviour 817 Some JInternalFrame Methods 820 Adding Compnents to JInternalFrame 821 setjmenubar() for JInternalFrame 822 InternalFrameListener 823 isvisible() with JInternalFrame 825 JLayeredPane 826 JLayeredPane Example 830 Layouts in JLayeredPane 832 More methods for JLayeredPane 833 JDesktopPane 836 showinternalmessagedialog 837 showinternalconfirmdialog 840 OC05 Page 10 of 11 Seer Computing Ltd

Exercise Twenty 845 Thirty Eight JWindow 847 Using JWindow 848 Thirty Nine Swing Timers and Progress Bars 850 Introduction 851 Methods for Swing Timers 854 Timers and Coaleace 856 JProgressBar 857 JProgressBar Example 858 JProgressBar Methods 860 Displaying text in the JProgressBar 861 JProgressBar Orientation 863 JProgressBar and ChangeListener 864 Using Threads to create a Splash screen 865 Cursors 867 Scope of Cursors 870 Creating a Custom Cursor 871 Forty System Tray 872 Introduction 873 System Tray Example 875 Forty One Java Built-in Choosers 878 JColorChooser 879 ChangeListener 885 setpreviewpanel() 888 Using setcolor() 889 Using AbstractColorChooserPanel 890 JFileChooser 892 setfileselectionmode() 897 setcontrolbuttonsareshown() 899 FileFilter 900 setacceptallfilefilterused() 902 addchoosablefilefilter 903 Some Methods for JFileChooser 904 ActionListener with JFileChooser 905 Exercise Twenty One 908 OC05 Page 11 of 11 Seer Computing Ltd