R4R
Right Place For Right Person TM
 
R4R Right ArrowJavaRight Arrow Core JavaRight ArrowCore Java Basic Tutorial
Previous Home Next

Separators in Java Programming


Introduction:

Separators help define the structure of a program.
The separators used in java program are parentheses, ( ), braces, { }, the period, ., and the semicolon,

Separators help define the structure of a program.
The separators used in java program are parentheses, ( ), braces, { }, the period, ., and the semicolon,

( )     Encloses arguments in method definitions and calling;
{ }     defines blocks of code and automatically initializes arrays
[ ]     declares array types and dereferences array values
;     terminates statements
,     separates successive identifiers in variable declarations
.     Selects a field or method from an object; separates package names from sub-package and class names
:     Used after loop labels


HOW TO USE SEPARATOR
another way to add separator is to use JSEPARATOR class used to add horizontal and vertical lines to the menu and tool bar


Descriptions:
 

 The code to add the menu items and separators to the menu is extremely simple, boiling down to something like this: 


SourceCode:

 
menu.add(menuItem1);
menu.add(menuItem2);
menu.add(menuItem3);
menu.addSeparator();
menu.add(rbMenuItem1);
menu.add(rbMenuItem2);
menu.addSeparator();
menu.add(cbMenuItem1);
menu.add(cbMenuItem2);
menu.addSeparator();
menu.add(submenu);




Output of SourceCode:
 

Separators in Java Programming

Previous Home Next
R4R Right ArrowJavaRight Arrow Core JavaRight ArrowCore Java Basic Tutorial

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R