Please, describe and/or show the code you have used. We can't know at this moment .... are you moving a component at absolute locations? are you using custom painting in an your component? are you...
Type: Posts; User: andbin
Please, describe and/or show the code you have used. We can't know at this moment .... are you moving a component at absolute locations? are you using custom painting in an your component? are you...
The content pane of JFrame has, by default, a BorderLayout. A BorderLayout subdivides the space in only 5 areas and only one component can be shown in each area.
Doing:
frame.add(xyz);
is...
The main point: you are not overriding the run() of Thread. ;)
But there is also other you should understand and improve ....
See the word "Argument". You are missing an argument. printf/format methods make use of the varargs feature since Java 5.
printf("format string", arg1, arg2 .............. );
In your case:
...
First, at binary level, there is no "negative" or "positive". Binary is 0s and 1s. Stop.
The knowledge of "negative" is given by a specific representation (on a word of N bits), that is mainly...
Yes. Was this your question or doubt?
setValue receives a copy of the reference to the Person object instantiated in main. This means that setValue cannot change the value of the 'p' variable in the...
And (besides Norm answer) I add another important issue: the mouseClicked (or any other event handling method) is not the appropriate moment/location where you can make a draw (except situations...
First, at programming level there is no difference between a cabled network and a wireless network. In other words, there isn't a code for cabled communication and a code for wireless communication....
No, not necessarily. It's just only one possible option. And it's not even easy because a string like that must be parsed/interpreted. There are apposite libraries for this. If you want to do this...
A web application is normally executed on a server machine and then the results (HTML plus other) are viewed/executed typically by a browser on the client machine.
At server side, being on...
The initialization to null is not really necessary in this case, because d1/d2 are assigned by format.parse before any use of these variables.
The main concept behind Date class is that it...
Your code is certainly a starting point. There are some things you can improve, for example instead to use java.awt.Frame, you can and should use javax.swing.JFrame (AWT is "old" nowadays). Another...
As GregBrannon correctly pointed out, your are missing many things. Your code is not a standalone GUI application and not even an "applet". You need to write several things to create a minimal but...
To avoid the warning, scrollingList must be:
JList<Object> scrollingList = new JList<Object>();
Speaking in general, it's not very good that the "value" is a JLabel. It should be a simple...
Firstly, since you want both an applet and a standalone "desktop" application, you should have a single panel (e.g. JPanel) that contains all your user-interface. Then it will be absolutely...
It depends on what is that data and what is its usage .... ;)
There is no clear answer without a well known context.
First, if you want to use the Full-Screen Exclusive Mode API, please, at least follow the official tutorial:
Lesson: Full-Screen Exclusive Mode API (The Java™ Tutorials > Bonus)
And second, your...
You miss one thing: the registration of the driver. Please, see here MySQL :: MySQL Connector/J Developer Guide :: 6.1 Connecting to MySQL Using the JDBC DriverManager Interface
A good start is Lesson: Concurrency (The Java™ Tutorials > Essential Classes)
Some more you can get from articles like Java 101: Understanding Java threads, Part 1: Introducing threads and...
How do you compile? From an IDE? Or manually with JDK tools from command prompt? If the latter, it may be a "classpath" problem. Do you know what is the classpath and how to set it? If not, see How...
Several things are really bad. First, never do a loop like that in runGUI. Also and mainly because the yield() is only an "hint" (from javadoc: A hint to the scheduler that the current thread is...
Eclipse has a "Fat Jar" plugin that can create a jar containing your classes/resources and all classes/resources from all dependencies.
Technically it's possible to do this from command prompt but...
If you mean: call the Servlet and include its output into the JSP .... you can use the <jsp:include> standard action. (note: with JSTL there is <c:import> that also works).
If you mean: call the...
Yes .... the same between a Mini car and a Porsche car. ;)
If the client connects to "localhost" there are certainly (at 99,9%) no problems. And if your client/server works well in this situation you have done your job as programmer.
If the client connects...