It can change over time, but what I meant was it is the same for every class at any given time, right? Until one of the classes changes its value...
Type: Posts; User: beer-in-box
It can change over time, but what I meant was it is the same for every class at any given time, right? Until one of the classes changes its value...
:D Thanks. That was soo clear :)
Hmm... I guess I could use some static methods in some of my apps...
How does this compare to usual method in terms of performance and resource consuming?
Hi,
Lately I've developed an interest in game developing and chosen libgdx as my library. So I was collecting resources and reading them. Someone gave me a link to a video (sadly I lost it with...
Thanks for the tips!
Do you mean "Provide the textfields from another class into the GUI"?
Honestly, I still cannot think a way of not using getters and setters. I am not against them and I...
Well, I kind of asked this question here (http://www.javaprogrammingforums.com/awt-java-swing/24952-event-handling-styles.html), but back then it was wise to use anonymous classes. And to be honest,...
It is working flawless and it is weird for me to say, but I kinda wanted this to fail. Because comparing the examples and my code, I feel like they are testing the connection for something, but I...
Thanks Norm! That will be my next objective. But, can you spot any potential problems with that? Because the others were so long and some of them were so complex, I thought I might be missing some...
Thanks for the tips :)
My procedure for testing network stuff goes like this: localhost, then my network ip, then the other computer. Never tried but assuming the right ip and port are provided, a...
Possibly (About being poorly written). I realized that it does not save anything into the file. So I put a sysout in every line. It gets stuck here:
bytesRead =...
Hi,
Recently I have been trying to send and receive stuff over network. I have two computers and I was practicing with them. Sending a simple text was easy, but file was not easy.
I kept trying...
Damn...
It is obvious now of course but... I thought the CardLayout is a little different than others and so I do not need this:
rightPanel.add(panelOne);
rightPanel.add(panelTwo);
I...
Okay. This is my main class, only calls the GUI:
public class SolveHere {
public static void main(String[] args) {
SolveSomehow m = new SolveSomehow();
m.setVisible(true);
}
}
Norm, I hope this is enough for you to help me. The attached file includes my source file and a compiled app. The source and app only have the codes about the CardLayout.
I have a JFrame, a JSplitPane as the container of the frame.
On the left side of the splitpane, there are two radio buttons (more to come, but I am stuck).
On the right side, there is a...
I was searching the net for this purpose and I noticed some people ask for money to look into the code.
I realize that inspecting a code which is not yours is though. I am also sure it is tougher...
Do we have a section to show our project codes for criticism?
And would anyone be interested in looking into some nasty code?
After struggling a long time with tutorials and trying to use ONLY...
lol. Now you said it, I am not sure either :) I think I meant if this is one of the proper ways of implementing the multithreading concept.
I see I used the same method as you did with your code...
I meant the starting thread.
Do the real world applications start the thread as I started? I mean like;
private Thread t3 = new Thread(new Runnable(){
@Override
public void run() {...
Like this? Look how I created t3 thread please.
I had to make them static, because I run them in the main method which is static.
public class ClassOne implements Runnable {
static ClassOne...
I asked the question wrong. So you gave me an answer which is obvious to me. Here is my problem:
I have one run() method per one class. But I have three other methods in every class.
I need this:...
And that is where my real struggle starts. How do I make these two run from different threads?
OK, here is my output (I put currentMillis thing to outside of the for loops).
t1 will start. 1362667052439
t1 started, t2 will. 1362667052439
t2 started, someMethod someMethod will.
And no...
That was quick :)
Yes, I am asking about these two. I actually don't have any problems with how and when run() methods are called.
In my mind, when I try to implement multithreading, I think...
Yes, and I think I did it by Thread.sleep(500). But look at the output. "Class two angry method" did not run until the "Class One some method" stopped.
So, how do I do that?