Kemal Sokolovic

Bartender
+ Follow
since Jun 19, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kemal Sokolovic

...and added a JPanel as a variable...


No, you are using java.awt.Panel, hence you should override the paint() method.

And welcome to the Ranch!

EDIT: Well, I guess you typed it faster.
10 years ago
This can be a good place to start with. Plenty of resources over there.
11 years ago
Generally it's a logarithm of base 2, which usually means that the problem is divided in half in each step of the algorithm (divide and conquer).
11 years ago
I didn't really understand your request. Can you please post some code to demonstrate the problem? What's wrong with the approach of using JTabbedPane, if you want a "button that acts like a tab"?
11 years ago
ItDoesntWorkIsUseless (<- click), please be more specific. The general principle proposed above should do the trick. Though, I would suggest you never have more than one JFrame per application; use JDialog instead.
11 years ago
Factory method pattern is a good place to start, also with some examples and comments on them. I am sure that you can find a lot of other resources by searching the internet a bit.
11 years ago
How to Use HTML in Swing Components and How to Use Editor Panes and Text Panes would be a good place to start. These both contain examples that you can use as a reference.
11 years ago
Welcome to the Ranch!

Keep in mind that the division operator denotes integer division if both operands are integers, and floating-point division otherwise. Yours is the first case - both of your operands are integers (e.g. 1/2 = 0 by integer division), hence the results you get.
11 years ago
And I hope this link will provide enough details for you about the question.
11 years ago
Even when the img is null an exception won't be thrown.
11 years ago
The code works fine with me, I can't see a problem (besides the fact that you are using show() method which is deprecated).
11 years ago
Welcome to the Ranch!

In order to get the most out of this community you need to ShowSomeEffort and TellTheDetails. However, you cannot expect to be provided with full solution since this forum is NotACodeMill.
11 years ago
If they are all in the same package, there won't be a problem with that; otherwise you would use import statement for other classes.
Though it's a question for another topic, I would suggest you read a Java tutorial, specifically the Packages section, to get more details. I'm posting from phone now so I can't provide a link, but if you Google for it you'll find it easily.
11 years ago