Fichas
CSE Lecture 28 Notes
Fichas del conjunto (34)
- 1javax.swinghas many GUI components
- 2JPanela general panel used to decompose the component
- 3JButtona button interface
- 4JPanel p =new JPanel();
- 5JButton b =new JButton("Label");
- 6BorderLayout()a common layout
- 7addActionListener()used to add some action to the GUI component
- 8ActionListenerobject necessary for the proper function of addActionListener; can be customized by overriding the actionPerformed (ActionEvent e) method
- 9printf()function used when one wants to print out values with some specific format
- 10printf() SyntaxSystem.out.printf("format-string" [, arg1, arg2, ]);
- 11format-stringcomposed of literals and format specifiers; arguments are required only if there are format specifiers in this object
- 12Format Specifiersinclude flags, width, precision, and conversion characters in the following sequence: %[flags][width][.precision] conversion-character
- 13-flag used to left-justify (default is to right-justify)
- 14+flag to output a plus (+) or minus (-) sign for a numerical value
- 150flag to force numerical values to be zero-padded (default is blank padding)
- 16,flag to call for a comma grouping separator (for numbers > 1000)
- 17(space)flag that will display a minus sign if the number is negative or a space if it is positive
- 18Widthspecifies the field width for outputting the argument and represents the minimum number of characters to be written to the output; must include space for expected commas and a decimal point
- 19Precisionused to restrict the output depending on the conversion; specifies the number of digits shown when outputting floating-point values or the length of a substring to extract from a String; numbers are rounded to the specified value
- 20dconversion character: decimal integer (for data types byte, short, int, long)
- 21fconversion character: floating-point number (for data types float, double)
- 22cconversion character: character (capital C will convert letters to uppercase)
- 23sconversion character: String (capital S will convert all the letters in the String to uppercase)
- 24hconversion character: hashcode (used to print a reference)
- 25nconversion character: newline (platform specific; use %n instead of \n for greater compatibility)
- 26format()method used to format a String in the same way printf() formatting operates
- 27Internal Errorsnot considered by throw/catch
- 28Runtime Exceptionsexceptions caused by the programmer; compiler does not check how these are handled
- 29All Exceptions Except Runtimeexceptions that can be handled through throw/catch; not the programmer's fault; compiler checks to make sure that these are handled
- 30Text-Based Programscan be parameterized by using command line arguments; file name and options are often typed after the program name at a command prompt
- 31Javaprovides access to arguments as an array of Strings parameter to the main method named args
- 32args.lengthcomputes the number of arguments
- 33Optionstraditionally begin with a dash (-)
- 34Switchesalternative nomenclature for options
Información
- Descripción
- (Notes) CSE 110 Fichas sobre CSE Lecture 28 Notes, creado por Branden Roper el 22/11/2017.
- Creado por
- Branden Roper
- Visitas
- 0
- Etiquetas
- Valoración