BASIC / CATATAN</>↗Basic19 Okt 2010
Every instance method has a variable with the name this that refers to the current object for which the method is being called. You can refer to any member of the current object from within an instance method or a constructor by using this keyword. Each time an instance method is called, the this variable […]
BASIC / CATATAN</>↗Basic19 Okt 2010
The return keyword is used to return from a method when its execution is complete. When a return statement is reached in a method, the program returns to the code that invoked it. A method can return a value or reference type or does not return a value. If a method does not return a […]
SWING / CATATAN</>↗Swing19 Okt 2010
To remove tabs from JTabbedPane we can use the following remove methods: remove(int index) method to remove a tab at the specified index. remove(Component component) method to remove a tab that has the specified child component. removeAll() method to remove all tabs. package org.kodejava.swing; import javax.swing.*; import java.awt.*; public class TabbedPaneRemoveTab extends JPanel { public […]
SWING / CATATAN</>↗Swing19 Okt 2010
To assign a keyboard shortcut for accessing JTabbedPane‘s tab you can use the setMnemonicAt(int tabIndex, int mnemonic) method of the JTabbedPane class. The tabIndex parameter is a zero-based value parameter which means that the first tab is at index number 0. For the mnenomic parameter you can use constants value defined in the java.awt.event.KeyEvent class. […]
SWING / CATATAN</>↗Swing19 Okt 2010
To set a tool tips for JTabbedPane‘s tabs you need to pass the tool tips when adding a new tab to the JTabbedPane. The addTab() method accept the following parameters: the tab’s title, image icon, a component that is going to be the content of the tabs and a string of tool tips information. When […]
SWING / CATATAN</>↗Swing18 Okt 2010
To enable or disable tabs in JTabbedPane you can use the JTabbedPane‘s setEnableAt(int index, boolean enable) method. The index is zero based, this means that the first tab is at index number 0. The enable parameter when set to true will enable the tab while setting to false will disable the tab. package org.kodejava.swing; import […]