method:getName ();return type:Stringcontent:ใช้คืนค่า ชื่อ ของ componentexample:JButton button = new JButton ( "cancel" ); String name = button.getName ();