Archive | TUT Java swing

[JavaSwing] JPanel

Content and Layout Order Create JPanel Border After the opening introduction to the JFrame and the introduction of JLabel, JButton and JTextField perhaps you have become familiar with how to create an interface in Java Swing. Prior to the introduction of frequently used objects, I think we should learn a very important it is to Container (container, holder) and […]

[Java swing] Using Border in Java

The simple border The border open border titled The combination of type long long time no border post on Swing, in this article I will guide you to learn how to use the Border. Literally is the contour in Java. We will turn to find out 4 contour as the category listed. Using simple border to create the Border, […]

[Java Swing] JComboBox in Java – JComboBox in Java

Creating Content for JComboBox JComboBox JComboBox Getting event is an object that allows you to select an element to click on the arrow of it. For example, I have a JFrame JComboBox selected from the following flags: Now we are going to learn by creating a JFrame JComboBox like on. How to create a JComboBox To create JComboBox we use the constructor […]

[Java swing] JToolBar in Java

JToolBar is a long bar with icons including the corresponding button is usually located under the menu, like toolbars in Word, excel with new buttons, open, save, … We will implement programs like the image above, including 3 new button, open, Save on the toolbar. When you click on the button below JTextArea will display the corresponding event. This toolbar you can […]

[Java swing] JFileChooser in Java

JFileChooser in Java is an object display frame allows you to open or save the file. It's like this: Now we will go as a simple example of open and save files. In the code above you noticed 2 displayed in order to open and save files are different. int select = fc.showOpenDialog(this); int select = fc.showSaveDialog(this); The next argument is that you can JFileChooser.APPROVE_OPTION […]

[Java Swing] JMenu in Java

The writing on the JMenu however find all this code, it is sufficient, explain the relatively clear. First we need to add a MenuBar in JFrame, JMenu then added to the MenuBar, the JMenuItem be added to the JMenu. The program includes JPopupmenu (right click). Also you need to have the image of the icon in the menu, copy the image into […]

[Java swing] Customize JTabbedPane

In my previous article introduced some basic JTabbenPane, this article we learn a little more for better customization for too JTabbedPane, like the picture below, have closed tab, More tab,… In which the most important is how we have to add new tab button, how each tab it close button tab. We will create 2 file, 1 […]

[Java swing] JTabbedPane in Java

You have to use the notepad or you are using eclipse, NetBean to java code and you can see we have many different tab. This article we will learn JTabbedPane, a component that allows you to create multiple tabs so. Create simple JTabbedPane Consider the following code to do simple demo shown above, in your code has relatively clear explanation. Beneath its code […]

[JavaSwing] JTextArea in Java

JTextArea is a component for displaying multiple lines of text at the same time the user can edit the text. Create a simple JTextArea Now we will practice even an example that allows you to type and edit text. In your code, and images were explained quite clearly the commands performed with JTextArea. Set the font and font color for you JTextArea […]

[Java Swing] JPasswordField in Java – JPasswordField in Java

Content Create JPasswordField Getting the facts and get the password from JPasswordField JPasswordField object allows us to enter into a line of text like JTextField but is hidden by asterisks (*) or dots to create a password (password). JPasswordField JTextField often used together to create a user name and password pairs as shown below: Now we'll go through JPasswordField […]