Java TM 2 Platform Std. Ed. v Overview Package Class Use Tree Deprecated Index Help

Size: px
Start display at page:

Download "Java TM 2 Platform Std. Ed. v Overview Package Class Use Tree Deprecated Index Help"

Transcription

1 1 sur :32 Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes SUMMARY: NESTED FIELD CONSTR METHOD DETAIL: FIELD CONSTR METHOD Java TM 2 Platform Std. Ed. v1.4.2 java.awt java.lang.object java.awt.component java.awt.list All Implemented Interfaces: Accessible, ImageObserver, ItemSelectable, MenuContainer, Serializable public class List extends Component implements ItemSelectable, Accessible The List component presents the user with a scrolling list of text items. The list can be set up so that the user can choose either one item or multiple items. For example, the code... List lst = new List(4, false); lst.add("mercury"); lst.add("venus"); lst.add("earth"); lst.add("javasoft"); lst.add("mars"); lst.add("jupiter"); lst.add("saturn"); lst.add("uranus"); lst.add("neptune"); lst.add("pluto"); cnt.add(lst); where cnt is a container, produces the following scrolling list: Clicking on an item that isn't selected selects it. Clicking on an item that is already selected deselects it. In the preceding example, only one item from the scrolling list can be selected at a time, since the second argument when creating the new scrolling list is false. Selecting an item causes any other selected item to be automatically deselected. Note that the list in the example shown was created with four visible rows. Once the list has been created, the number of visible rows cannot be changed. A default List is created with four rows, so that lst = new List() is equivalent to list = new List(4, false).

2 2 sur :32 Beginning with Java 1.1, the Abstract Window Toolkit sends the List object all mouse, keyboard, and focus events that occur over it. (The old AWT event model is being maintained only for backwards compatibility, and its use is discouraged.) When an item is selected or deselected by the user, AWT sends an instance of ItemEvent to the list. When the user double-clicks on an item in a scrolling list, AWT sends an instance of ActionEvent to the list following the item event. AWT also generates an action event when the user presses the return key while an item in the list is selected. If an application wants to perform some action based on an item in this list being selected or activated by the user, it should implement ItemListener or ActionListener as appropriate and register the new listener to receive events from this list. For multiple-selection scrolling lists, it is considered a better user interface to use an external gesture (such as clicking on a button) to trigger the action. JDK1.0 ItemEvent, ItemListener, ActionEvent, ActionListener, Serialized Form protected class List.AccessibleAWTList This class implements accessibility support for the List class. Nested classes inherited from class java.awt.component Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy Fields inherited from class java.awt.component BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT Fields inherited from interface java.awt.image.imageobserver ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH List() Creates a new scrolling list. List(int rows) Creates a new scrolling list initialized with the specified number of visible lines. List(int rows, boolean multiplemode) Creates a new scrolling list initialized to display the specified number of rows. void add(string item) Adds the specified item to the end of scrolling list.

3 3 sur :32 void add(string item, int index) Adds the specified item to the the scrolling list at the position indicated by the index. void addactionlistener(actionlistener l) Adds the specified action listener to receive action events from this list. void additem(string item) Deprecated. replaced by add(string). void additem(string item, int index) Deprecated. replaced by add(string, int). void additemlistener(itemlistener l) Adds the specified item listener to receive item events from this list. void addnotify() Creates the peer for the list. boolean allowsmultipleselections() Deprecated. As of JDK version 1.1, replaced by ismultiplemode(). void clear() Deprecated. As of JDK version 1.1, replaced by removeall(). int countitems() Deprecated. As of JDK version 1.1, replaced by getitemcount(). void delitem(int position) Deprecated. replaced by remove(string) and remove(int). void delitems(int start, int end) Deprecated. As of JDK version 1.1, Not for public use in the future. This method is expected to be retained only as a package private method. void deselect(int index) Deselects the item at the specified index. AccessibleContext getaccessiblecontext() Gets the AccessibleContext associated with this List. ActionListener[] getactionlisteners() Returns an array of all the action listeners registered on this list. String getitem(int index) Gets the item associated with the specified index. int getitemcount() Gets the number of items in the list. ItemListener[] getitemlisteners() Returns an array of all the item listeners registered on this list. String[] getitems() Gets the items in the list. EventListener[] getlisteners(class listenertype) Returns an array of all the objects currently registered as FooListeners upon this List. Dimension getminimumsize() Determines the minimum size of this scrolling list. Dimension getminimumsize(int rows) Gets the minumum dimensions for a list with the specified number of rows. Dimension getpreferredsize() Gets the preferred size of this scrolling list. Dimension getpreferredsize(int rows) Gets the preferred dimensions for a list with the specified number of rows.

4 4 sur :32 int getrows() Gets the number of visible lines in this list. int getselectedindex() Gets the index of the selected item on the list, int[] getselectedindexes() Gets the selected indexes on the list. String getselecteditem() Gets the selected item on this scrolling list. String[] getselecteditems() Gets the selected items on this scrolling list. Object[] getselectedobjects() Returns the selected items on the list in an array of objects. int getvisibleindex() Gets the index of the item that was last made visible by the method makevisible. boolean isindexselected(int index) Determines if the specified item in this scrolling list is selected. boolean ismultiplemode() Determines whether this list allows multiple selections. boolean isselected(int index) Deprecated. As of JDK version 1.1, replaced by isindexselected(int). void makevisible(int index) Makes the item at the specified index visible. Dimension minimumsize() Deprecated. As of JDK version 1.1, replaced by getminimumsize(). Dimension minimumsize(int rows) Deprecated. As of JDK version 1.1, replaced by getminimumsize(int). protected String paramstring() Returns the parameter string representing the state of this scrolling list. Dimension preferredsize() Deprecated. As of JDK version 1.1, replaced by getpreferredsize(). Dimension preferredsize(int rows) Deprecated. As of JDK version 1.1, replaced by getpreferredsize(int). protected void processactionevent(actionevent e) Processes action events occurring on this component by dispatching them to any registered ActionListener objects. protected void processevent(awtevent e) Processes events on this scrolling list. protected void processitemevent(itemevent e) Processes item events occurring on this list by dispatching them to any registered ItemListener objects. void remove(int position) Remove the item at the specified position from this scrolling list. void remove(string item) Removes the first occurrence of an item from the list. void removeactionlistener(actionlistener l) Removes the specified action listener so that it no longer receives action events from this list.

5 5 sur :32 void removeall() Removes all items from this list. void removeitemlistener(itemlistener l) Removes the specified item listener so that it no longer receives item events from this list. void removenotify() Removes the peer for this list. void replaceitem(string newvalue, int index) Replaces the item at the specified index in the scrolling list with the new string. void select(int index) Selects the item at the specified index in the scrolling list. void setmultiplemode(boolean b) Sets the flag that determines whether this list allows multiple selections. void setmultipleselections(boolean b) Deprecated. As of JDK version 1.1, replaced by setmultiplemode(boolean). Methods inherited from class java.awt.component action, add, addcomponentlistener, addfocuslistener, addhierarchyboundslistener, addhierarchylistener, addinputmethodlistener, addkeylistener, addmouselistener, addmousemotionlistener, addmousewheellistener, addpropertychangelistener, addpropertychangelistener, applycomponentorientation, arefocustraversalkeysset, bounds, checkimage, checkimage, coalesceevents, contains, contains, createimage, createimage, createvolatileimage, createvolatileimage, deliverevent, disable, disableevents, dispatchevent, dolayout, enable, enable, enableevents, enableinputmethods, firepropertychange, firepropertychange, firepropertychange, getalignmentx, getalignmenty, getbackground, getbounds, getbounds, getcolormodel, getcomponentat, getcomponentat, getcomponentlisteners, getcomponentorientation, getcursor, getdroptarget, getfocuscyclerootancestor, getfocuslisteners, getfocustraversalkeys, getfocustraversalkeysenabled, getfont, getfontmetrics, getforeground, getgraphics, getgraphicsconfiguration, getheight, gethierarchyboundslisteners, gethierarchylisteners, getignorerepaint, getinputcontext, getinputmethodlisteners, getinputmethodrequests, getkeylisteners, getlocale, getlocation, getlocation, getlocationonscreen, getmaximumsize, getmouselisteners, getmousemotionlisteners, getmousewheellisteners, getname, getparent, getpeer, getpropertychangelisteners, getpropertychangelisteners, getsize, getsize, gettoolkit, gettreelock, getwidth, getx, gety, gotfocus, handleevent, hasfocus, hide, imageupdate, inside, invalidate, isbackgroundset, iscursorset, isdisplayable, isdoublebuffered, isenabled, isfocusable, isfocuscycleroot, isfocusowner, isfocustraversable, isfontset, isforegroundset, islightweight, isopaque, isshowing, isvalid, isvisible, keydown, keyup, layout, list, list, list, list, list, locate, location, lostfocus, mousedown, mousedrag, mouseenter, mouseexit, mousemove, mouseup, move, nextfocus, paint, paintall, postevent, prepareimage, prepareimage, print, printall, processcomponentevent, processfocusevent, processhierarchyboundsevent, processhierarchyevent, processinputmethodevent, processkeyevent, processmouseevent, processmousemotionevent, processmousewheelevent, remove, removecomponentlistener, removefocuslistener, removehierarchyboundslistener, removehierarchylistener, removeinputmethodlistener, removekeylistener, removemouselistener, removemousemotionlistener, removemousewheellistener, removepropertychangelistener, removepropertychangelistener, repaint, repaint, repaint, repaint, requestfocus, requestfocus, requestfocusinwindow, requestfocusinwindow, reshape, resize, resize, setbackground, setbounds, setbounds, setcomponentorientation, setcursor, setdroptarget, setenabled, setfocusable, setfocustraversalkeys, setfocustraversalkeysenabled, setfont, setforeground, setignorerepaint, setlocale, setlocation, setlocation, setname, setsize, setsize, setvisible, show, show, size, tostring, transferfocus, transferfocusbackward, transferfocusupcycle, update, validate

6 6 sur :32 Methods inherited from class java.lang.object clone, equals, finalize, getclass, hashcode, notify, notifyall, wait, wait, wait List public List() throws HeadlessException Creates a new scrolling list. By default, there are four visible lines and multiple selections are not allowed. Note that this is a convenience method for List(0, false). Also note that the number of visible lines in the list cannot be changed after it has been created. Throws: HeadlessException - if GraphicsEnvironment.isHeadless() returns true. GraphicsEnvironment.isHeadless() List public List(int rows) throws HeadlessException Creates a new scrolling list initialized with the specified number of visible lines. By default, multiple selections are not allowed. Note that this is a convenience method for List(rows, false). Also note that the number of visible rows in the list cannot be changed after it has been created. rows - the number of items to show. Throws: HeadlessException - if GraphicsEnvironment.isHeadless() returns true. GraphicsEnvironment.isHeadless() List public List(int rows, boolean multiplemode) throws HeadlessException Creates a new scrolling list initialized to display the specified number of rows. Note that if zero rows are specified, then the list will be created with a default of four rows. Also note that the number of visible rows in the list cannot be changed after it has been created. If the value of multiplemode is true, then the user can select multiple items from the list. If it is false, only one item at a time can be selected. rows - the number of items to show. multiplemode - if true, then multiple selections are allowed; otherwise, only one item can be

7 7 sur :32 selected at a time. Throws: HeadlessException - if GraphicsEnvironment.isHeadless() returns true. GraphicsEnvironment.isHeadless() addnotify public void addnotify() Creates the peer for the list. The peer allows us to modify the list's appearance without changing its functionality. Overrides: addnotify in class Component Component.isDisplayable(), Component.removeNotify() removenotify public void removenotify() Removes the peer for this list. The peer allows us to modify the list's appearance without changing its functionality. Overrides: removenotify in class Component Component.isDisplayable(), Component.addNotify() getitemcount public int getitemcount() Gets the number of items in the list. the number of items in the list getitem(int) countitems public int countitems() Deprecated. As of JDK version 1.1, replaced by getitemcount().

8 8 sur :32 getitem public String getitem(int index) Gets the item associated with the specified index. index - the position of the item an item that is associated with the specified index getitemcount() getitems public String[] getitems() Gets the items in the list. a string array containing items of the list select(int), deselect(int), isindexselected(int) add public void add(string item) Adds the specified item to the end of scrolling list. item - the item to be added additem public void additem(string item) Deprecated. replaced by add(string). add public void add(string item, int index) Adds the specified item to the the scrolling list at the position indicated by the index. The index is zero-based. If the value of the index is less than zero, or if the value of the index is greater than or equal to the number of items in the list, then the item is added to the end of the list.

9 9 sur :32 item - the item to be added; if this parameter is null then the item is treated as an empty string, "" index - the position at which to add the item additem public void additem(string item, int index) Deprecated. replaced by add(string, int). replaceitem public void replaceitem(string newvalue, int index) Replaces the item at the specified index in the scrolling list with the new string. newvalue - a new string to replace an existing item index - the position of the item to replace Throws: ArrayIndexOutOfBoundsException - if index is out of range removeall public void removeall() Removes all items from this list. remove(java.lang.string), delitems(int, int) clear public void clear() Deprecated. As of JDK version 1.1, replaced by removeall(). remove public void remove(string item) Removes the first occurrence of an item from the list.

10 10 sur :32 item - the item to remove from the list Throws: IllegalArgumentException - if the item doesn't exist in the list remove public void remove(int position) Remove the item at the specified position from this scrolling list. position - the index of the item to delete Throws: ArrayIndexOutOfBoundsException - if the position is less than 0 or greater than getitemcount()-1 add(string, int) delitem public void delitem(int position) Deprecated. replaced by remove(string) and remove(int). getselectedindex public int getselectedindex() Gets the index of the selected item on the list, the index of the selected item, or -1 if no item is selected, or if more that one item is selected select(int), deselect(int), isindexselected(int) getselectedindexes public int[] getselectedindexes() Gets the selected indexes on the list. an array of the selected indexes of this scrolling list; if no items are selected, a zero-length array is returned select(int), deselect(int), isindexselected(int)

11 ist (Java 2 Platform SE v1.4.2) 1 sur :32 getselecteditem public String getselecteditem() Gets the selected item on this scrolling list. the selected item on the list, or null if no item is selected select(int), deselect(int), isindexselected(int) getselecteditems public String[] getselecteditems() Gets the selected items on this scrolling list. an array of the selected items on this scrolling list select(int), deselect(int), isindexselected(int) getselectedobjects public Object[] getselectedobjects() Returns the selected items on the list in an array of objects. Specified by: getselectedobjects in interface ItemSelectable ItemSelectable select public void select(int index) Selects the item at the specified index in the scrolling list. Note that this method should be primarily used to initially select an item in this component. Programmatically calling this method will not trigger an ItemEvent. The only way to trigger an ItemEvent is by user interaction. index - the position of the item to select getselecteditem(), deselect(int), isindexselected(int) deselect public void deselect(int index)

12 12 sur :32 Deselects the item at the specified index. If the item at the specified index is not selected, or if the index is out of range, then the operation is ignored. index - the position of the item to deselect select(int), getselecteditem(), isindexselected(int) isindexselected public boolean isindexselected(int index) Determines if the specified item in this scrolling list is selected. index - the item to be checked true if the specified item has been selected; false otherwise select(int), deselect(int) isselected public boolean isselected(int index) Deprecated. As of JDK version 1.1, replaced by isindexselected(int). getrows public int getrows() Gets the number of visible lines in this list. Note that once the List has been created, this number will never change. the number of visible lines in this scrolling list ismultiplemode public boolean ismultiplemode() Determines whether this list allows multiple selections. true if this list allows multiple selections; otherwise, false

13 13 sur :32 setmultiplemode(boolean) allowsmultipleselections public boolean allowsmultipleselections() Deprecated. As of JDK version 1.1, replaced by ismultiplemode(). setmultiplemode public void setmultiplemode(boolean b) Sets the flag that determines whether this list allows multiple selections. b - if true then multiple selections are allowed; otherwise, only one item from the list can be selected at once ismultiplemode() setmultipleselections public void setmultipleselections(boolean b) Deprecated. As of JDK version 1.1, replaced by setmultiplemode(boolean). getvisibleindex public int getvisibleindex() Gets the index of the item that was last made visible by the method makevisible. the index of the item that was last made visible makevisible(int) makevisible public void makevisible(int index) Makes the item at the specified index visible. index - the position of the item getvisibleindex()

14 14 sur :32 getpreferredsize public Dimension getpreferredsize(int rows) Gets the preferred dimensions for a list with the specified number of rows. rows - number of rows in the list the preferred dimensions for displaying this scrolling list given that the specified number of rows must be visible Component.getPreferredSize() preferredsize public Dimension preferredsize(int rows) Deprecated. As of JDK version 1.1, replaced by getpreferredsize(int). getpreferredsize public Dimension getpreferredsize() Gets the preferred size of this scrolling list. Overrides: getpreferredsize in class Component the preferred dimensions for displaying this scrolling list Component.getPreferredSize() preferredsize public Dimension preferredsize() Deprecated. As of JDK version 1.1, replaced by getpreferredsize(). Overrides: preferredsize in class Component getminimumsize public Dimension getminimumsize(int rows) Gets the minumum dimensions for a list with the specified number of rows.

15 15 sur :32 rows - number of rows in the list the minimum dimensions for displaying this scrolling list given that the specified number of rows must be visible Component.getMinimumSize() minimumsize public Dimension minimumsize(int rows) Deprecated. As of JDK version 1.1, replaced by getminimumsize(int). getminimumsize public Dimension getminimumsize() Determines the minimum size of this scrolling list. Overrides: getminimumsize in class Component the minimum dimensions needed to display this scrolling list Component.getMinimumSize() minimumsize public Dimension minimumsize() Deprecated. As of JDK version 1.1, replaced by getminimumsize(). Overrides: minimumsize in class Component additemlistener public void additemlistener(itemlistener l) Adds the specified item listener to receive item events from this list. Item events are sent in response to user input, but not in response to calls to select or deselect. If listener l is null, no exception is thrown and no action is performed. Specified by: additemlistener in interface ItemSelectable l - the item listener

16 ist (Java 2 Platform SE v1.4.2) 6 sur :32 removeitemlistener(java.awt.event.itemlistener), getitemlisteners(), select(int), deselect(int), ItemEvent, ItemListener removeitemlistener public void removeitemlistener(itemlistener l) Removes the specified item listener so that it no longer receives item events from this list. If listener l is null, no exception is thrown and no action is performed. Specified by: removeitemlistener in interface ItemSelectable l - the item listener additemlistener(java.awt.event.itemlistener), getitemlisteners(), ItemEvent, ItemListener getitemlisteners public ItemListener[] getitemlisteners() Returns an array of all the item listeners registered on this list. all of this list's ItemListeners or an empty array if no item listeners are currently registered 1.4 additemlistener(java.awt.event.itemlistener), removeitemlistener(java.awt.event.itemlistener), ItemEvent, ItemListener addactionlistener public void addactionlistener(actionlistener l) Adds the specified action listener to receive action events from this list. Action events occur when a user double-clicks on a list item. If listener l is null, no exception is thrown and no action is performed. l - the action listener removeactionlistener(java.awt.event.actionlistener), getactionlisteners(), ActionEvent, ActionListener

17 17 sur :32 removeactionlistener public void removeactionlistener(actionlistener l) Removes the specified action listener so that it no longer receives action events from this list. Action events occur when a user double-clicks on a list item. If listener l is null, no exception is thrown and no action is performed. l - the action listener addactionlistener(java.awt.event.actionlistener), getactionlisteners(), ActionEvent, ActionListener getactionlisteners public ActionListener[] getactionlisteners() Returns an array of all the action listeners registered on this list. all of this list's ActionListeners or an empty array if no action listeners are currently registered 1.4 addactionlistener(java.awt.event.actionlistener), removeactionlistener(java.awt.event.actionlistener), ActionEvent, ActionListener getlisteners public EventListener[] getlisteners(class listenertype) Returns an array of all the objects currently registered as FooListeners upon this List. FooListeners are registered using the addfoolistener method. You can specify the listenertype argument with a class literal, such as FooListener.class. For example, you can query a List l for its item listeners with the following code: ItemListener[] ils = (ItemListener[])(l.getListeners(ItemListener.class)); If no such listeners exist, this method returns an empty array. Overrides: getlisteners in class Component listenertype - the type of listeners requested; this parameter should specify an interface that descends from java.util.eventlistener an array of all objects registered as FooListeners on this list, or an empty array if no such

18 18 sur :32 listeners have been added Throws: ClassCastException - if listenertype doesn't specify a class or interface that implements java.util.eventlistener 1.3 getitemlisteners() processevent protected void processevent(awtevent e) Processes events on this scrolling list. If an event is an instance of ItemEvent, it invokes the processitemevent method. Else, if the event is an instance of ActionEvent, it invokes processactionevent. If the event is not an item event or an action event, it invokes processevent on the superclass. Note that if the event parameter is null the behavior is unspecified and may result in an exception. Overrides: processevent in class Component e - the event ActionEvent, ItemEvent, processactionevent(java.awt.event.actionevent), processitemevent(java.awt.event.itemevent) processitemevent protected void processitemevent(itemevent e) Processes item events occurring on this list by dispatching them to any registered ItemListener objects. This method is not called unless item events are enabled for this component. Item events are enabled when one of the following occurs: An ItemListener object is registered via additemlistener. Item events are enabled via enableevents. Note that if the event parameter is null the behavior is unspecified and may result in an exception. e - the item event ItemEvent, ItemListener, additemlistener(java.awt.event.itemlistener), Component.enableEvents(long)

19 19 sur :32 processactionevent protected void processactionevent(actionevent e) Processes action events occurring on this component by dispatching them to any registered ActionListener objects. This method is not called unless action events are enabled for this component. Action events are enabled when one of the following occurs: An ActionListener object is registered via addactionlistener. Action events are enabled via enableevents. Note that if the event parameter is null the behavior is unspecified and may result in an exception. e - the action event ActionEvent, ActionListener, addactionlistener(java.awt.event.actionlistener), Component.enableEvents(long) paramstring protected String paramstring() Returns the parameter string representing the state of this scrolling list. This string is useful for debugging. Overrides: paramstring in class Component the parameter string of this scrolling list delitems public void delitems(int start, int end) Deprecated. As of JDK version 1.1, Not for public use in the future. This method is expected to be retained only as a package private method. getaccessiblecontext public AccessibleContext getaccessiblecontext() Gets the AccessibleContext associated with this List. For lists, the AccessibleContext takes the form of an AccessibleAWTList. A new AccessibleAWTList instance is created, if necessary. Specified by: getaccessiblecontext in interface Accessible

20 20 sur :32 Overrides: getaccessiblecontext in class Component an AccessibleAWTList that serves as the AccessibleContext of this List Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes SUMMARY: NESTED FIELD CONSTR METHOD DETAIL: FIELD CONSTR METHOD Java TM 2 Platform Std. Ed. v1.4.2 Submit a bug or feature For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright 2003, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

AWT LIST CLASS. The List represents a list of text items. The list can be configured to that user can choose either one item or multiple items.

AWT LIST CLASS. The List represents a list of text items. The list can be configured to that user can choose either one item or multiple items. http://www.tutorialspoint.com/awt/awt_list.htm AWT LIST CLASS Copyright tutorialspoint.com Introduction The List represents a list of text items. The list can be configured to that user can choose either

More information

Simply Sweet Components. Ken Orr. The MathWorks Component oriented design

Simply Sweet Components. Ken Orr. The MathWorks   Component oriented design Simply Sweet Components Component oriented design Ken Orr The MathWorks http://explodingpixels.wordpress.com/ What are we going to talk about? 2 What are we going to talk about? Bob (the Swing developer)

More information

Package <default> Class Diagram Summary. Class Summary. <default> AccessPanel. DataHolder. DbConn. Fx.3. HeaderRenderer. MyTableModel.

Package <default> Class Diagram Summary. Class Summary. <default> AccessPanel. DataHolder. DbConn. Fx.3. HeaderRenderer. MyTableModel. 1, Package Class Diagram Summary Class Summary AccessPanel DataHolder DbConn Fx Fx.3 HeaderRenderer MyTableModel PasswordPanel recordtablemod el 1, 2, Class Diagram

More information

Courier system report

Courier system report Courier system report Your Company Chris Table of Contents Use Case Scheduling....................................................3 Stereotypes..........................................................4

More information

CP2085 Java for VB Programmers. Assessment 1. Colin Hopson /12/05

CP2085 Java for VB Programmers. Assessment 1. Colin Hopson /12/05 CP2085 Java for VB Programmers Assessment 1 Colin Hopson 0482647 02/12/05 i Contents 1 Introduction... 1 1.1 Overview... 1 1.2 Tasks Attempted... 1 2 Graphical User Interface... 1 2.1 Design... 1 2.2 Implementation...

More information

AWT CHOICE CLASS. Choice control is used to show pop up menu of choices. Selected choice is shown on the top of the menu.

AWT CHOICE CLASS. Choice control is used to show pop up menu of choices. Selected choice is shown on the top of the menu. http://www.tutorialspoint.com/awt/awt_choice.htm AWT CHOICE CLASS Copyright tutorialspoint.com Introduction Choice control is used to show pop up menu of choices. Selected choice is shown on the top of

More information

AWT TEXTFIELD CLASS. Constructs a new empty text field with the specified number of columns.

AWT TEXTFIELD CLASS. Constructs a new empty text field with the specified number of columns. http://www.tutorialspoint.com/awt/awt_textfield.htm AWT TEXTFIELD CLASS Copyright tutorialspoint.com Introduction The textfield component allows the user to edit single line of text.when the user types

More information

UI Software Organization

UI Software Organization UI Software Organization The user interface From previous class: Generally want to think of the UI as only one component of the system Deals with the user Separate from the functional core (AKA, the app

More information

Howto designa UI classlibrary. LightweightJava Meetup, Johannes Döbler

Howto designa UI classlibrary. LightweightJava Meetup, Johannes Döbler Howto designa UI classlibrary LightweightJava Meetup, 25.11.2015 Johannes Döbler jd@civilian-framework.org Developervirtues Craftsmanship Write clean and efficient code Algorithmic Find and implement solutions

More information

AWT WINDOW CLASS. The class Window is a top level window with no border and no menubar. It uses BorderLayout as default layout manager.

AWT WINDOW CLASS. The class Window is a top level window with no border and no menubar. It uses BorderLayout as default layout manager. http://www.tutorialspoint.com/awt/awt_window.htm AWT WINDOW CLASS Copyright tutorialspoint.com Introduction The class Window is a top level window with no border and no menubar. It uses BorderLayout as

More information

Inheritance Systems. Merchandise. Television Camcorder Shirt Shoe Dress 9.1.1

Inheritance Systems. Merchandise. Television Camcorder Shirt Shoe Dress 9.1.1 Merchandise Inheritance Systems Electronics Clothing Television Camcorder Shirt Shoe Dress Digital Analog 9.1.1 Another AcademicDisciplines Hierarchy Mathematics Engineering Algebra Probability Geometry

More information

AWT CHECKBOX CLASS. Creates a check box with the specified label and sets the specified state.

AWT CHECKBOX CLASS. Creates a check box with the specified label and sets the specified state. http://www.tutorialspoint.com/awt/awt_checkbox.htm AWT CHECKBOX CLASS Copyright tutorialspoint.com Introduction Checkbox control is used to turn an option ontrue or offfalse. There is label for each checkbox

More information

public static void negate2(list<integer> t)

public static void negate2(list<integer> t) See the 2 APIs attached at the end of this worksheet. 1. Methods: Javadoc Complete the Javadoc comments for the following two methods from the API: (a) / @param @param @param @return @pre. / public static

More information

GUI Event Handlers (Part I)

GUI Event Handlers (Part I) GUI Event Handlers (Part I) 188230 Advanced Computer Programming Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Department of Computer Engineering Khon Kaen University 1 Agenda General event

More information

OBJECT ORIENTED PROGRAMMING. Java GUI part 1 Loredana STANCIU Room B616

OBJECT ORIENTED PROGRAMMING. Java GUI part 1 Loredana STANCIU Room B616 OBJECT ORIENTED PROGRAMMING Java GUI part 1 Loredana STANCIU loredana.stanciu@upt.ro Room B616 What is a user interface That part of a program that interacts with the user of the program: simple command-line

More information

AWT SCROLLBAR CLASS. Scrollbar control represents a scroll bar component in order to enable user to select from range of values.

AWT SCROLLBAR CLASS. Scrollbar control represents a scroll bar component in order to enable user to select from range of values. http://www.tutorialspoint.com/awt/awt_scrollbar.htm AWT SCROLLBAR CLASS Copyright tutorialspoint.com Introduction Scrollbar control represents a scroll bar component in order to enable user to select from

More information

public static boolean isoutside(int min, int max, int value)

public static boolean isoutside(int min, int max, int value) See the 2 APIs attached at the end of this worksheet. 1. Methods: Javadoc Complete the Javadoc comments for the following two methods from the API: (a) / @param @param @param @return @pre. / public static

More information

Vector (Java 2 Platform SE 5.0) Overview Package Class Use Tree Deprecated Index Help

Vector (Java 2 Platform SE 5.0) Overview Package Class Use Tree Deprecated Index Help Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes SUMMARY: NESTED FIELD CONSTR METHOD DETAIL: FIELD CONSTR METHOD Página 1 de 30 Java TM 2 Platform

More information

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7 PROGRAMMING DESIGN USING JAVA (ITT 303) Graphical User Interface Unit 7 Learning Objectives At the end of this unit students should be able to: Build graphical user interfaces Create and manipulate buttons,

More information

CS/120 Final Exam. Name

CS/120 Final Exam. Name CS/120 Final Exam Name 16 pts 1. Trace the following segment of code and to the left of each System.out.println instruction show the precise output that results when this code segment executes. java.awt.container

More information

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

Starting Out with Java: From Control Structures Through Objects Sixth Edition Starting Out with Java: From Control Structures Through Objects Sixth Edition Chapter 12 A First Look at GUI Applications Chapter Topics 12.1 Introduction 12.2 Creating Windows 12.3 Equipping GUI Classes

More information

PIC 20A GUI with swing

PIC 20A GUI with swing PIC 20A GUI with swing Ernest Ryu UCLA Mathematics Last edited: November 22, 2017 Hello swing Let s create a JFrame. import javax. swing.*; public class Test { public static void main ( String [] args

More information

Java Event Handling -- 1

Java Event Handling -- 1 Java Event Handling -- 1 Event Handling Happens every time a user interacts with a user interface. For example, when a user pushes a button, or types a character. 2 A Typical Situation: Scrollbar AWTEvent

More information

Where the methods with the Java 1.0 comment are deprecated. The

Where the methods with the Java 1.0 comment are deprecated. The 10 Java Text and Date 10.1 Text input 10.1.1 Single-line text input Single-line text can be entered into a Java applet using the TextField action, which is contained in the java.awt.textfield class. Its

More information

Event Driven Programming

Event Driven Programming Event Driven Programming 1. Objectives... 2 2. Definitions... 2 3. Event-Driven Style of Programming... 2 4. Event Polling Model... 3 5. Java's Event Delegation Model... 5 6. How to Implement an Event

More information

GUI Event Handlers (Part II)

GUI Event Handlers (Part II) GUI Event Handlers (Part II) 188230 Advanced Computer Programming Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Department of Computer Engineering Khon Kaen University 1 Agenda Listener

More information

G.PULLAIAH COLLEGE OF ENGINEERING AND TECHNOLOGY

G.PULLAIAH COLLEGE OF ENGINEERING AND TECHNOLOGY G.PULLAIAH COLLEGE OF ENGINEERING AND TECHNOLOGY Kurnool 518002 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Lecture notes of OBJECT ORIENTED PROGRAMMING USING THROUGH JAVA Prepared by: P. Rama Rao,

More information

AWT DIALOG CLASS. Dialog control represents a top-level window with a title and a border used to take some form of input from the user.

AWT DIALOG CLASS. Dialog control represents a top-level window with a title and a border used to take some form of input from the user. http://www.tutorialspoint.com/awt/awt_dialog.htm AWT DIALOG CLASS Copyright tutorialspoint.com Introduction Dialog control represents a top-level window with a title and a border used to take some form

More information

MiG Calendar JavaBeans API. Ellen Bergdahl

MiG Calendar JavaBeans API. Ellen Bergdahl MiG Calendar JavaBeans API Ellen Bergdahl MiG InfoCom AB 2007 Package com.miginfocom.beans Page 2 of 196 com.miginfocom.beans.abstractheaderbean com.miginfocom.beans Class AbstractHeaderBean java.lang.object

More information

Java Applets / Flash

Java Applets / Flash Java Applets / Flash Java Applet vs. Flash political problems with Microsoft highly portable more difficult development not a problem less so excellent visual development tool Applet / Flash good for:

More information

Package <default> Class Diagram Summary. Class Summary. <default> DataAcross. DataHolder. MahiReader. RecordReader. Servera. Servera.

Package <default> Class Diagram Summary. Class Summary. <default> DataAcross. DataHolder. MahiReader. RecordReader. Servera. Servera. 1, Package Class Diagram Summary Class Summary DataAcross DataHolder MahiReader RecordReader Servera Servera.1 SimpleTransfor m ValServer ValServerThrea d XmlGen XMLToSQL 1, 2,

More information

CS-140 Fall 2017 Test 2 Version A Nov. 29, 2017

CS-140 Fall 2017 Test 2 Version A Nov. 29, 2017 CS-140 Fall 2017 Test 2 Version A Nov. 29, 2017 Name: 1. (10 points) For the following, Check T if the statement is true, the F if the statement is false. (a) T F : An interface defines the list of fields

More information

CHAPTER 2. Java Overview

CHAPTER 2. Java Overview Networks and Internet Programming (0907522) CHAPTER 2 Java Overview Instructor: Dr. Khalid A. Darabkh Objectives The objectives of this chapter are: To discuss the classes present in the java.awt package

More information

Creating Rich GUIs in Java. Amy Fowler Staff Engineer JavaSoft

Creating Rich GUIs in Java. Amy Fowler Staff Engineer JavaSoft 1 Creating Rich GUIs in Java Amy Fowler Staff Engineer JavaSoft 2 Tutorial Overview Toolkit principles & architecture GUI layout management Building custom components AWT futures 3 Toolkit Principles &

More information

Some client code. output. subtype polymorphism As dynamic binding occurs the behavior (i.e., methods) follow the objects. Squarer

Some client code. output. subtype polymorphism As dynamic binding occurs the behavior (i.e., methods) follow the objects. Squarer public class Base { protected int theint = 100; System.out.println( theint ); public class Doubler extends Base { System.out.println( theint*2 ); public class Tripler extends Base { System.out.println(

More information

Chapter 11 Paper Practice

Chapter 11 Paper Practice Chapter 11 Paper Practice Scrambled Code For each method, rearrange the lines of code in order to build the functionality required by the specification and tests. To accomplish this, you are given three

More information

Project 2 - A Simple Chat Program

Project 2 - A Simple Chat Program Project 2 - A Simple Chat Program Minimum Effort Due: (Part 1) 2/11/2007 (Sunday) Complete Project Due: (Part 2) 2/23/2007 (Friday) Late Project Due: (Last Chance) 2/24/2007 (Saturday) Overview In this

More information

COURSE DESCRIPTION. John Lewis and William Loftus; Java: Software Solutions; Addison Wesley

COURSE DESCRIPTION. John Lewis and William Loftus; Java: Software Solutions; Addison Wesley COURSE DESCRIPTION Dept., Number Semester hours IS 323 Course Title 4 Course Coordinator Object Oriented Programming Catherine Dwyer and John Molluzzo Catalog Description (2004-2006) Continued development

More information

Module 4 Multi threaded Programming, Event Handling. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Module 4 Multi threaded Programming, Event Handling. OOC 4 th Sem, B Div Prof. Mouna M. Naravani Module 4 Multi threaded Programming, Event Handling OOC 4 th Sem, B Div 2017-18 Prof. Mouna M. Naravani Event Handling Complete Reference 7 th ed. Chapter No. 22 Event Handling Any program that uses a

More information

GUI Event Handling 11. GUI Event Handling. Objectives. What is an Event? Hierarchical Model (JDK1.0) Delegation Model (JDK1.1)

GUI Event Handling 11. GUI Event Handling. Objectives. What is an Event? Hierarchical Model (JDK1.0) Delegation Model (JDK1.1) Objectives Write code to handle events that occur in a GUI 11 GUI Event Handling Describe the concept of adapter classes, including how and when to use them Determine the user action that originated the

More information

UNIT-3 : MULTI THREADED PROGRAMMING, EVENT HANDLING. A Multithreaded program contains two or more parts that can run concurrently.

UNIT-3 : MULTI THREADED PROGRAMMING, EVENT HANDLING. A Multithreaded program contains two or more parts that can run concurrently. UNIT-3 : MULTI THREADED PROGRAMMING, EVENT HANDLING 1. What are Threads? A thread is a single path of execution of code in a program. A Multithreaded program contains two or more parts that can run concurrently.

More information

Unit 1- Java Applets. Applet Programming. Local Applet and Remote Applet ** Applet and Application

Unit 1- Java Applets. Applet Programming. Local Applet and Remote Applet ** Applet and Application Applet Programming Applets are small Java applications that can be accessed on an Internet server, transported over Internet, and can be automatically installed and run as a part of a web document. An

More information

Building Java Programs Bonus Slides

Building Java Programs Bonus Slides Building Java Programs Bonus Slides Graphical User Interfaces Copyright (c) Pearson 2013. All rights reserved. Graphical input and output with JOptionPane JOptionPane An option pane is a simple dialog

More information

The AWT Event Model 9

The AWT Event Model 9 The AWT Event Model 9 Course Map This module covers the event-based GUI user input mechanism. Getting Started The Java Programming Language Basics Identifiers, Keywords, and Types Expressions and Flow

More information

The javabook Package

The javabook Package A The javabook Package We document the javabook classes in this appendix. You can get information on the standard Java packages from a number of sources. If you use commercial Java compilers from Borland,

More information

JFrame In Swing, a JFrame is similar to a window in your operating system

JFrame In Swing, a JFrame is similar to a window in your operating system JFrame In Swing, a JFrame is similar to a window in your operating system All components will appear inside the JFrame window Buttons, text labels, text fields, etc. 5 JFrame Your GUI program must inherit

More information

Name: Pennkey: CIS 120 Final Exam December 21, Do not begin the exam until you are told to do so. You have 120 minutes to complete the exam.

Name: Pennkey: CIS 120 Final Exam December 21, Do not begin the exam until you are told to do so. You have 120 minutes to complete the exam. Name: Pennkey: CIS 120 Final Exam December 21, 2011 My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing this examination. Signature:

More information

Preview from Notesale.co.uk Page 12 of 78

Preview from Notesale.co.uk Page 12 of 78 In JAVA run time environment, to perform any kind of operation or task or an action that will be performed with respect to either class or an interface. Whenever we pass invalid data as an input to the

More information

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism.

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism. Outline Inheritance Class Extension Overriding Methods Inheritance and Constructors Polymorphism Abstract Classes Interfaces 1 OOP Principles Encapsulation Methods and data are combined in classes Not

More information

Java AWT Windows, Text, & Graphics

Java AWT Windows, Text, & Graphics 2 AWT Java AWT Windows, Text, & Graphics The Abstract Windows Toolkit (AWT) contains numerous classes and methods that allow you to create and manage applet windows and standard windows that run in a GUI

More information

Chapter 24. Graphical Objects The GraphicalObject Class

Chapter 24. Graphical Objects The GraphicalObject Class 290 Chapter 24 Graphical Objects The simple graphics we saw earlier created screen artifacts. A screen artifact is simply an image drawn on the screen (viewport), just as a picture can be drawn on a whiteboard.

More information

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani Module 5 The Applet Class, Swings OOC 4 th Sem, B Div 2017-18 Prof. Mouna M. Naravani The Applet Class Types of Applets (Abstract Window Toolkit) Offers richer and easy to use interface than AWT. An Applet

More information

Unit 7: Event driven programming

Unit 7: Event driven programming Faculty of Computer Science Programming Language 2 Object oriented design using JAVA Dr. Ayman Ezzat Email: ayman@fcih.net Web: www.fcih.net/ayman Unit 7: Event driven programming 1 1. Introduction 2.

More information

Name CS/120 Sample Exam #1 -- Riley. a) Every program has syntax, which refers to the form of the code, and, which refers to the meaning of the code.

Name CS/120 Sample Exam #1 -- Riley. a) Every program has syntax, which refers to the form of the code, and, which refers to the meaning of the code. Name CS/120 Sample Exam #1 -- Riley Please show all of your work. 1. For each part below write the term, symbols, or phrase from class that best fits the description. (Each part is worth 2 points.) a)

More information

CS 170 Java Programming 1. Week 9: Learning about Loops

CS 170 Java Programming 1. Week 9: Learning about Loops CS 170 Java Programming 1 Week 9: Learning about Loops What s the Plan? Topic 1: A Little Review ACM GUI Apps, Buttons, Text and Events Topic 2: Learning about Loops Different kinds of loops Using loops

More information

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani Module 5 The Applet Class, Swings OOC 4 th Sem, B Div 2016-17 Prof. Mouna M. Naravani The Applet Class Types of Applets (Abstract Window Toolkit) Offers richer and easy to use interface than AWT. An Applet

More information

Swing/GUI Cheat Sheet

Swing/GUI Cheat Sheet General reminders To display a Swing component, you must: Swing/GUI Cheat Sheet Construct and initialize the component. Example: button = new JButton ("ButtonLabel"); Add it to the content pane of the

More information

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 10(b): Working with Controls Agenda 2 Case study: TextFields and Labels Combo Boxes buttons List manipulation Radio buttons and checkboxes

More information

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

CSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT CSE 143 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/

More information

CSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction

CSC 160 LAB 8-1 DIGITAL PICTURE FRAME. 1. Introduction CSC 160 LAB 8-1 DIGITAL PICTURE FRAME PROFESSOR GODFREY MUGANDA DEPARTMENT OF COMPUTER SCIENCE 1. Introduction Download and unzip the images folder from the course website. The folder contains 28 images

More information

Block I Unit 2. Basic Constructs in Java. AOU Beirut Computer Science M301 Block I, unit 2 1

Block I Unit 2. Basic Constructs in Java. AOU Beirut Computer Science M301 Block I, unit 2 1 Block I Unit 2 Basic Constructs in Java M301 Block I, unit 2 1 Developing a Simple Java Program Objectives: Create a simple object using a constructor. Create and display a window frame. Paint a message

More information

GUI in Java TalentHome Solutions

GUI in Java TalentHome Solutions GUI in Java TalentHome Solutions AWT Stands for Abstract Window Toolkit API to develop GUI in java Has some predefined components Platform Dependent Heavy weight To use AWT, import java.awt.* Calculator

More information

Java GUI Design: the Basics

Java GUI Design: the Basics Java GUI Design: the Basics Daniel Brady July 25, 2014 What is a GUI? A GUI is a graphical user interface, of course. What is a graphical user interface? A graphical user interface is simply a visual way

More information

AP CS Unit 11: Graphics and Events

AP CS Unit 11: Graphics and Events AP CS Unit 11: Graphics and Events This packet shows how to create programs with a graphical interface in a way that is consistent with the approach used in the Elevens program. Copy the following two

More information

1 OBJECT-ORIENTED PROGRAMMING 1

1 OBJECT-ORIENTED PROGRAMMING 1 PREFACE xvii 1 OBJECT-ORIENTED PROGRAMMING 1 1.1 Object-Oriented and Procedural Programming 2 Top-Down Design and Procedural Programming, 3 Problems with Top-Down Design, 3 Classes and Objects, 4 Fields

More information

Please show all of your work.

Please show all of your work. Please show all of your work. Name CS/120 Exam #2 Sample Exam 1. For each part below write the term, symbols, or phrase from class that best fits the description. (Each part is worth 2 points.) a) This

More information

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani Module 5 The Applet Class, Swings OOC 4 th Sem, B Div 2016-17 Prof. Mouna M. Naravani The layout manager helps lay out the components held by this container. When you set a layout to null, you tell the

More information

Graphics. Lecture 18 COP 3252 Summer June 6, 2017

Graphics. Lecture 18 COP 3252 Summer June 6, 2017 Graphics Lecture 18 COP 3252 Summer 2017 June 6, 2017 Graphics classes In the original version of Java, graphics components were in the AWT library (Abstract Windows Toolkit) Was okay for developing simple

More information

SD Module-1 Advanced JAVA

SD Module-1 Advanced JAVA Assignment No. 4 SD Module-1 Advanced JAVA R C (4) V T Total (10) Dated Sign Title: Transform the above system from command line system to GUI based application Problem Definition: Write a Java program

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Copyright 1992-2015 by Pearson Education, Inc. All Rights Reserved. Data structures Collections of related data items. Discussed in depth in Chapters 16 21. Array objects Data

More information

CS1 Studio Project: Connect Four

CS1 Studio Project: Connect Four CS1 Studio Project: Connect Four Due date: November 8, 2006 In this project, we will implementing a GUI version of the two-player game Connect Four. The goal of this project is to give you experience in

More information

SD Module-1 Advanced JAVA. Assignment No. 4

SD Module-1 Advanced JAVA. Assignment No. 4 SD Module-1 Advanced JAVA Assignment No. 4 Title :- Transform the above system from command line system to GUI based application Problem Definition: Write a Java program with the help of GUI based Application

More information

INHERITANCE. Spring 2019

INHERITANCE. Spring 2019 INHERITANCE Spring 2019 INHERITANCE BASICS Inheritance is a technique that allows one class to be derived from another A derived class inherits all of the data and methods from the original class Suppose

More information

The AWT Package, Graphics- Introduction to Images

The AWT Package, Graphics- Introduction to Images Richard G Baldwin (512) 223-4758, baldwin@austin.cc.tx.us, http://www2.austin.cc.tx.us/baldwin/ The AWT Package, Graphics- Introduction to Images Java Programming, Lecture Notes # 170, Revised 09/23/98.

More information

Computer Science 210: Data Structures. Intro to Java Graphics

Computer Science 210: Data Structures. Intro to Java Graphics Computer Science 210: Data Structures Intro to Java Graphics Summary Today GUIs in Java using Swing in-class: a Scribbler program READING: browse Java online Docs, Swing tutorials GUIs in Java Java comes

More information

Virtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4.

Virtualians.ning.pk. 2 - Java program code is compiled into form called 1. Machine code 2. native Code 3. Byte Code (From Lectuer # 2) 4. 1 - What if the main method is declared as private? 1. The program does not compile 2. The program compiles but does not run 3. The program compiles and runs properly ( From Lectuer # 2) 4. The program

More information

COE318 Lecture Notes Week 10 (Nov 7, 2011)

COE318 Lecture Notes Week 10 (Nov 7, 2011) COE318 Software Systems Lecture Notes: Week 10 1 of 5 COE318 Lecture Notes Week 10 (Nov 7, 2011) Topics More about exceptions References Head First Java: Chapter 11 (Risky Behavior) The Java Tutorial:

More information

javax.swing Swing Timer

javax.swing Swing Timer 27 javax.swing Swing SwingUtilities SwingConstants Timer TooltipManager JToolTip 649 650 Swing CellRendererPane Renderer GrayFilter EventListenerList KeyStroke MouseInputAdapter Swing- PropertyChangeSupport

More information

GUI DYNAMICS Lecture July 26 CS2110 Summer 2011

GUI DYNAMICS Lecture July 26 CS2110 Summer 2011 GUI DYNAMICS Lecture July 26 CS2110 Summer 2011 GUI Statics and GUI Dynamics 2 Statics: what s drawn on the screen Components buttons, labels, lists, sliders, menus,... Containers: components that contain

More information

Graphical User Interfaces. Comp 152

Graphical User Interfaces. Comp 152 Graphical User Interfaces Comp 152 Procedural programming Execute line of code at a time Allowing for selection and repetition Call one function and then another. Can trace program execution on paper from

More information

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

Datenbank-Praktikum. Universität zu Lübeck Sommersemester 2006 Lecture: Swing. Ho Ngoc Duc 1 Datenbank-Praktikum Universität zu Lübeck Sommersemester 2006 Lecture: Swing Ho Ngoc Duc 1 Learning objectives GUI applications Font, Color, Image Running Applets as applications Swing Components q q Text

More information

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages.

Command-Line Applications. GUI Libraries GUI-related classes are defined primarily in the java.awt and the javax.swing packages. 1 CS257 Computer Science I Kevin Sahr, PhD Lecture 14: Graphical User Interfaces Command-Line Applications 2 The programs we've explored thus far have been text-based applications A Java application is

More information

CSCI 053. Week 5 Java is like Alice not based on Joel Adams you may want to take notes. Rhys Price Jones. Introduction to Software Development

CSCI 053. Week 5 Java is like Alice not based on Joel Adams you may want to take notes. Rhys Price Jones. Introduction to Software Development CSCI 053 Introduction to Software Development Rhys Price Jones Week 5 Java is like Alice not based on Joel Adams you may want to take notes Objectives Learn to use the Eclipse IDE Integrated Development

More information

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

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science mluckner@mini.pw.edu.pl http://www.mini.pw.edu.pl/~lucknerm } Abstract Window Toolkit Delegates creation and

More information

CO Java SE 8: Fundamentals

CO Java SE 8: Fundamentals CO-83527 Java SE 8: Fundamentals Summary Duration 5 Days Audience Application Developer, Developer, Project Manager, Systems Administrator, Technical Administrator, Technical Consultant and Web Administrator

More information

CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal

CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal CS 209 Spring, 2006 Lab 8: GUI Development Instructor: J.G. Neal Objectives: To gain experience with the programming of: 1. Graphical user interfaces (GUIs), 2. GUI components, and 3. Event handling (required

More information

Introduction to the JAVA UI classes Advanced HCI IAT351

Introduction to the JAVA UI classes Advanced HCI IAT351 Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing

More information

CS/ENGRD 2110 SPRING Lecture 2: Objects and classes in Java

CS/ENGRD 2110 SPRING Lecture 2: Objects and classes in Java 1 CS/ENGRD 2110 SPRING 2018 Lecture 2: Objects and classes in Java http://courses.cs.cornell.edu/cs2110 Homework HW1 2 The answers you handed in at the end of lecture 1 showed mass confusion! Perhaps 80%

More information

C12a: The Object Superclass and Selected Methods

C12a: The Object Superclass and Selected Methods CISC 3115 TY3 C12a: The Object Superclass and Selected Methods Hui Chen Department of Computer & Information Science CUNY Brooklyn College 10/4/2018 CUNY Brooklyn College 1 Outline The Object class and

More information

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Course Overview This course teaches programmers the skills necessary to create Java programming system applications and satisfies the

More information

Handling Mouse and Keyboard Events

Handling Mouse and Keyboard Events Handling Mouse and Keyboard Events 605.481 1 Java Event Delegation Model EventListener handleevent(eventobject handleevent(eventobject e); e); EventListenerObject source.addlistener(this);

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

Lecture 3: Java Graphics & Events

Lecture 3: Java Graphics & Events Lecture 3: Java Graphics & Events CS 62 Fall 2017 Kim Bruce & Alexandra Papoutsaki Text Input Scanner class Constructor: myscanner = new Scanner(System.in); can use file instead of System.in new Scanner(new

More information

Graphical User Interfaces 2

Graphical User Interfaces 2 Graphical User Interfaces 2 CSCI 136: Fundamentals CSCI 136: Fundamentals of Computer of Science Computer II Science Keith II Vertanen Keith Vertanen Copyright 2011 Extending JFrame Dialog boxes Overview

More information

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)

DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) Section 5 AGENDA 8. Events

More information

Advanced Java Unit 6: Review of Graphics and Events

Advanced Java Unit 6: Review of Graphics and Events Advanced Java Unit 6: Review of Graphics and Events This is a review of the basics of writing a java program that has a graphical interface. To keep things simple, all of the graphics programs will follow

More information

13 (ono@is.nagoya-u.ac.jp) 2008 1 15 1 factory., factory,. 2 2.,, JFileChooser. 1. Java,,, Serializable *1., FigBase ( 1). FigBase.java 3 5. 1 import java. lang.*; 2 import java. awt.*; 3 import java.

More information

OBJECT ORIENTED PROGRAMMING. Course 8 Loredana STANCIU Room B613

OBJECT ORIENTED PROGRAMMING. Course 8 Loredana STANCIU Room B613 OBJECT ORIENTED PROGRAMMING Course 8 Loredana STANCIU loredana.stanciu@upt.ro Room B613 Applets A program written in the Java programming language that can be included in an HTML page A special kind of

More information

CS/ENGRD 2110 FALL Lecture 2: Objects and classes in Java

CS/ENGRD 2110 FALL Lecture 2: Objects and classes in Java 1 CS/ENGRD 2110 FALL 2017 Lecture 2: Objects and classes in Java http://courses.cs.cornell.edu/cs2110 CMS VideoNote.com, PPT slides, DrJava 2 CMS. Visit course webpage, click Links, then CMS for 2110.

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 18 17/01/13 11:46 Java Applets 2 of 18 17/01/13 11:46 Java applets embedding Java applications

More information