Matti Poro

Ranch Hand
+ Follow
since Dec 03, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Matti Poro



If I load a class that way, is it possible to replace (override) methods in the created object?
17 years ago


Looks like you're putting the boxes too much to the right.
17 years ago
The methods should be inside the class.

17 years ago
You can define a custom pattern in SimpleDateFormat. It inherits a method String format(Date date)
17 years ago
There are detailed instructions for many routers at http://www.portforward.com/routers.htm how to forward a port.


Can you use that?
17 years ago
http://java.sun.com/docs/books/tutorial/2d/index.html

Override JPanel's paintComponent(Graphics g) method:



Then use a thread to increase or decrease the alpha value.
17 years ago
I have a server application and a client applet and I want to know what the best way to communicate between them is. I have thought of two possibilities.
The first one is a text-based protocol where messages are sent by using DataOutputStream.writeUTF(String str).
In the other a code (byte) describing the message is sent first, and then data in various formats (byte, long, String). Less data (in bytes) would be needed to sent but the problem is that if the receiver didn't read the right number of bytes, the next messages would be screwed up.
Which method would you recommend or is there an article I should read?

Edit: It is a multiplayer game. If a player's status changes (which happens often), the new status needs to be sent to other players.
[ March 28, 2006: Message edited by: Matti Poro ]
17 years ago
myFrame.setAlwaysOnTop(true);

Inherited from Window.
18 years ago
Or JComponent. Canvas is a heavy-weight (AWT) component and the classes which start with J are light-weight components (Swing). You shouldn't usually mix AWT and Swing in your program because it can cause problems like the one you experienced.
18 years ago
The JPanel will be added with the JScrollPane.
18 years ago
Here's an example:


[ March 02, 2006: Message edited by: Matti Poro ]
18 years ago
Put static modifier back to the main-method. What kind of compilation errors did it give when you removed the statics?
18 years ago
You add a component to a JScrollPane, not vice versa. Make sure it is m_scrollpane you added to the container (JFrame) and not m_itempanel.
18 years ago