Lando Chan

Greenhorn
+ Follow
since Apr 15, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Lando Chan

I found out a useful site which explains about this focus
From reading this "Tab shifts the focus in the forward direction. Shift-Tab moves the focus in the backward direction. For example, in FocusConceptsDemo, the first button has the initial focus. Tabbing moves the focus through the buttons into the text area. Additional tabbing moves the cursor within the text area but not out of the text area because, inside a text area, Tab is not a focus traversal key. However, Control-Tab moves the focus out of the text area and into the first text field. Likewise, Control-Shift-Tab moves the focus out of the text area and into the previous component. The Control key is used by convention to move the focus out of any component that treats Tab in a special way, such as JTable."

I got the feeling that it is not possible to solve my problem
6 years ago
I dont quite understand why you give me sscce. I guess my description is unclear so let me describe it one more.

It is not exactly a problem.
Just imagine you want to login your facebook account, first you insert the email textfield and press tab button to move to the password textfield. I want to know if I can apply that to my program.

For your information, I have two JTextArea and I want that when I press tab it moves to the next JTextArea

Thanks
6 years ago
Hello, as the subject states, it is about how to make the tab in our keyboard take the focus from one textarea to the next textarea.
I have found some code across the Internet, although it does not work because there is no clsTabOrder class in my function.
This is the code

Maybe somebody could tell me what is this clsTabOrder, or have another alternative for this problem.
Thank You.
6 years ago
Hello, I have a problem when the scrollpane are too long. Just look at the image
How to make the image stay the same while I scroll down the panel ?
I only included the essential part of my code since it is a very long code
6 years ago
It is may be unclear but f is a frame.
This is the code which I have included in the previous post
6 years ago
Adding the image ? Do not you see ? I use paintComponent to draw that image.
6 years ago
It is a long code and I do not think that other part of code will affect the solution in any way. In short I use combination of ArrayList<TextArea> for those japanese english translation and ArrayList<JButton> for those delete button. and adding all of them in sequence to the gridpanel.
6 years ago
Hello, I have a problem when the scrollpane are too long. Just look at the image

How to make the image stay the same while I scroll down the panel ?

This is part of my code

And this is how I set the background image


I also have tried on my own, two trial.
First, I search wheter I can set the background on the frame instead, and the result is none. It is not possible

Second I tried to make a new panel, and put this as my background panel, and add the scrollpane to this panel (before, I put the scrollpane on the frame). But, the problem comes from the unmoving scrollpane/ Failed
I tried another alternative as to set the layout of this panel as border layout, the scrollpane is working fine, but the background cannot be seen even though I setOpaque(false) this panel.

Please help me. Thank You.
6 years ago
And  the class has a parameter
6 years ago
Hello, so I have a main class where everything start. In the main class I add one button which has actionlistener with action performed like this

I have a problem in the subclass where I cannot use the function. This is how it looks in short


If it is the main class I can create the class and use the function like

But it does not seem to work in the subclass.
Please help me, Thank you
6 years ago
Guys, Thank you, I have found the solution, but if you have another alternative, I will appreciate that.
This is the code and it change font on JButton throughout my programs.
6 years ago
What is "before swing starts running" mean ? is it before import javax.swing ?
6 years ago

This is what I meant. This is only for one class. There are other class as well. So, is there a more efficient alternative that I can use to set like "the default font" to 20 because the default font is so small, I want to increase it. Thank You.
6 years ago