202 Posted Topics

Member Avatar for jpsider

You could use a [URL="http://docs.oracle.com/javase/1.4.2/docs/api/java/text/DecimalFormat.html"]DecimalFormat[/URL]. You'll want something like: [CODE] DecimalFormat df = new DecimalFormat("#.##"); double test = 242.23232; System.out.println(df.format(test));[/CODE]

Member Avatar for jpsider
0
131
Member Avatar for HelenLF

As long as the domain is relevant this sounds alright. The most important point is to ensure your domains won't confuse customers ("Why are exampleproduct.com and myproductexample the same???"). Search engines attempt to demote sites that are purely designed to funnel traffic to a page as spammers try to use …

Member Avatar for HelenLF
0
128
Member Avatar for 03hasnam

Although I'm not familiar with this library, but a quick Google search came up with this guide [URL="http://rxtx.qbang.org/wiki/index.php/Deploying_JAVA_with_RXTX"]here[/URL].

Member Avatar for m1n1m3
0
195
Member Avatar for freakvista

Classes are a way of representing objects in a program. The real world is made up of numerous things like tables, chairs, and couches. These objects have properties like height, width, and color. Classes allow you represent these objects by grouping variables together and developing methods to manipulate them in …

Member Avatar for dmanw100
0
123
Member Avatar for mihirpatel12

You should start by checking if they have some sort of API. If so, what you're trying to do shouldn't be too hard.

Member Avatar for mihirpatel12
-1
132
Member Avatar for battlex2010

First: having your users input the server's IP address is probably the most proper way to do what you'd like. If you try to simply crawl a network for a server you may run into problems. You need to know your network's structure to determine whether or not this approach …

Member Avatar for battlex2010
0
198
Member Avatar for clerisy
Re: LIFO

LIFO is short for [B]l[/B]ast [B]i[/B]n, [B]f[/B]irst [B]o[/B]ut. That should help get you started.

Member Avatar for dmanw100
0
121
Member Avatar for free_dom

There is no platform independent way to do this. You could use [URL="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Runtime.html"]Runtime[/URL] to run an OS specific utility to gather this information. Getting OS information is very easy. I would suggest checking the different [URL="http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html"]system properties[/URL] you can access.

Member Avatar for steve_kamlp
0
186
Member Avatar for DarkPyros

Real numbers don't have to be integers. 1.232 and 4/3 are both potential real numbers, but you're storing integers. Otherwise this looks correct to me.

Member Avatar for Moschops
0
305
Member Avatar for kbakersr

Since you're using a string I would recommend consulting [URL="http://www.cplusplus.com/reference/string/string/"]this reference[/URL] to see the different methods available for working with it. You can access the first character in the string like you could an array. In your case this would be something like: [CODE]if(line[0] == 'A') { // Place the …

Member Avatar for ravenous
0
153
Member Avatar for jade_91

You could create a station class that stored the line (or lines) which it services. Depending on how your lines are managed you could either store its name in a string or a reference to the appropriate line class instance. Your calculation function could then determine which station is closest …

Member Avatar for jade_91
0
122
Member Avatar for scheppy

I would recommend checking out [URL="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Random.html#nextInt%28int%29"]this[/URL] method.

Member Avatar for scheppy
0
164
Member Avatar for dhija22

You'll need the JDK which you can get from the [URL="http://www.java.com/en/"]official site[/URL]. Once you have that, installing Eclipse should be as easy as downloading the ZIP. If I remember correctly you can get it without an installer so it simply needs extracted and then you can run it.

Member Avatar for dmanw100
0
166
Member Avatar for usmansajid

Perhaps you could copy the value you're going to move, then move the items that will be behind it over one index, then write the value back into the array?

Member Avatar for hfx642
0
1K
Member Avatar for nesnes

Does the write to the file succeed before you call the delete()? Perhaps the PrintWriter is still attached to inFile even after the close call?

Member Avatar for ~s.o.s~
0
806
Member Avatar for prasanna123

[URL="http://java.sun.com/j2ee/tutorial/1_3-fcs/index.html"]This[/URL] is a good place to familiarize yourself with J2EE. If you have time to work through the tutorial, I'd recommend it. How long do you have?

Member Avatar for dmanw100
0
237
Member Avatar for BBA07

You must first identify what functionality of the class you are trying to test. What you write depends on how you want to test the class. I'm not an expert on JUnit testing, but [URL="http://www.vogella.de/articles/JUnit/article.html"]this[/URL] article might help a lot.

Member Avatar for DavidKroukamp
0
406
Member Avatar for Razer13

Perhaps the [CODE]label = SetImage("C:\\Users\\Documents"); App\\ImagesDoc_001.jpg");[/CODE] is causing problems for you? I would bet you probably want [CODE] label = SetImage("C:\\Users\\Documents\\App\\ImagesDoc_001.jpg");[/CODE]

Member Avatar for NormR1
0
139
Member Avatar for timmy568

You simply need to check if the length of the string is greater than 0. The error you're getting is resulting from the charAt(0) call on a string that has no first element (probably the user simply pressed 'enter' without typing anything). Try adding this check: [CODE]public void screenRunner(){ boolean …

Member Avatar for timmy568
0
231
Member Avatar for syeda amna

The [URL="http://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/JWindow.html"]JWindow[/URL] class creates a window with no title bar or the associated buttons. A [URL="http://docs.oracle.com/javase/6/docs/api/javax/swing/JFrame.html"]JFrame[/URL] looks more or less like a normal window that you would expect to see in any application. I personally like JFrames more.

Member Avatar for mKorbel
0
2K
Member Avatar for mortanto
Member Avatar for StephNicolaou
0
151
Member Avatar for 47pirates

One approach would be creating a class to handle networking and simply sharing that object between all your classes. That class would manage the sending and receiving of the messages. You would probably need to create a way for each object to ask the class if messages had arrived for …

Member Avatar for 47pirates
0
185
Member Avatar for Daigan

Where is the buttons array defined? You might make a getter method to access it from outside the class (as the references it stores should still be valid).

Member Avatar for Daigan
0
143
Member Avatar for SouthernBark30

One surefire (although drastic) solution is a wipe and reload of the operating system. If you've had significant problems with viruses/malware in the past or have installed and uninstalled large amounts of software this could help. Another approach would be [URL="http://kb.wisc.edu/page.php?id=1688"]disabling unnecessary programs[/URL] from your startup sequence. WARNING: only disable …

Member Avatar for swifttech
0
139
Member Avatar for agrzesiak

Reading the file with a Scanner is a good start. Now consider the format of you data: you have character strings separated by spaces. This means you could use the .split() method on spaces (" ") to break up your unknown number of scores into a String[]. Remember that the …

Member Avatar for agrzesiak
0
4K
Member Avatar for Priyanka8989

If you want to pass information from within the JSON object, you need to parse it out. A quick Google search returned two, but I've never used them and give no warranty that they're correct. They're [URL="http://json.org/java/"]here[/URL] and [URL="http://jackson.codehaus.org/"]here[/URL]. You might be able to store the whole object in the …

Member Avatar for dmanw100
0
178
Member Avatar for nickmi

Look into [URL="http://docs.oracle.com/javase/tutorial/networking/index.html"]Java Networking[/URL]. You most likely want to have a PHP script running on a server that reads from some source for current currency prices. This script would run when your application accesses it. The script could aggregate your data and send it back to the client. You then …

Member Avatar for hfx642
0
210
Member Avatar for michellecrossle

One method would be to set up unique URLs and track which users register through that page. Then you would simply use basic tracking techniques to review how often they return to your site or if they convert to premium customers (depending on your model). You could also run giveaway …

Member Avatar for Matthew Anton
0
290
Member Avatar for Daigan

Why not lay out 9 buttons in a 3x3 grid? If you wanted to make it 3D (similar to a Rubik's cube), then you could lay out a number of these grids beside each other to represent the numerous sides.

Member Avatar for Daigan
0
125
Member Avatar for dennysimon

Remember that you can pass multiple files to javac to compile. Instead of doing them separately, try javacing them at the same time.

Member Avatar for dmanw100
0
115
Member Avatar for OVOXO

I believe what you want to do is iterate through the 2D array with a pair of nested for loops. You could either generate the number as you traverse the array. I'm not sure what your array description (the {1,1,2,2,3,3,...}) means though.

Member Avatar for dmanw100
0
121
Member Avatar for sirlink99

You probably want to look into [URL="http://en.wikipedia.org/wiki/Machine_learning"]machine learning[/URL]. What you want to do isn't easy without a strong background in statistics, so I would also recommend looking into that. Basically one way this algorithm could work is through building a complex Bayesian network that links changes in color and relation …

Member Avatar for harinath_2007
0
177
Member Avatar for sirlink99

The Java random number generator, like in all other languages, actually generates pseudorandom numbers. This means the numbers are not truly random, but appear to be so (and for a game are more than sufficiently random). The numbers are not truly random due to the nature of computers: they do …

Member Avatar for sirlink99
0
3K
Member Avatar for sharathg.satya

I believe the problem lies in the fact that you create a new instance of the Games class, but you never actually call .start() on it. It appears all the constructor does is set the visibility and size. You need to call .start() on the Games object you create (perhaps …

Member Avatar for sharathg.satya
0
2K
Member Avatar for ajacintha

Java frames have a [URL="http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Frame.html#isResizable%28%29"]isResizable()[/URL] method that allows you to disable the user's ability to resize the window.

Member Avatar for dmanw100
0
85
Member Avatar for Empireryan

If you don't want to modify the original array, why not just copy that array into the result array for the function and perform the sort on it? If you're returning a different array, there's no reason not to simply use it for the computation. Also you may be interested …

Member Avatar for dmanw100
0
2K
Member Avatar for capton
Member Avatar for umair jameel

I'm assuming you're doing this to learn Java, so this should get you started: [CODE]int counter = 0; // Declare your variables int value = 1; int max = 10; // You can define ("hard code") this, or read it in while(counter < max) { System.out.println(value + " "); // …

Member Avatar for stultuske
1
1K
Member Avatar for Stein102

How is your data stored in the text file? You most likely would need to read in a string and parse out an integer, double, etc. If you're storing more than one character per entry you'll need to do something similar. Also, how are you separating each item in the …

Member Avatar for dmanw100
0
137
Member Avatar for deluksic

You might try limiting the number of refreshes you do by using a timer. It won't make it look great, but it should eliminate the worst flickering. Perhaps 2 refreshes a second?

Member Avatar for deluksic
-1
2K
Member Avatar for lethal.b

Threads can be written in a number of ways, but if they complete their run() method, they will terminate (die). You can easily get around this by putting the code to execute in a while loop that simply executes a [CODE]break;[/CODE] if you want it to exit. What it sounds …

Member Avatar for stultuske
0
104
Member Avatar for Panathinaikos22

Drawing text straight to the screen (without displaying any application) requires some knowledge of the OS you're using. Most will still require some form of window to be open for the application. You might consider looking into writing a widget?

Member Avatar for dmanw100
0
187
Member Avatar for sirlink99

This sounds like something you could easily solve by putting a short password on your user account and locking the computer (by using the Start menu or Windows Key + L) when you're not around.

Member Avatar for dmanw100
0
96
Member Avatar for 03hasnam

You can easily add a check to your method for user-defined public holidays, but you must define the holidays yourself. I would suggest adding a simple definition file that is loaded into memory when your program starts in case this method is called often.

Member Avatar for dmanw100
0
2K
Member Avatar for wallet123

Arrays are fixed size structures that are useful for quickly accessing data. You can think of them as a partitioned box where each partition is an index in the array; that is, each index can store one element of the type you declared the array for. An example would be: …

Member Avatar for dmanw100
0
127
Member Avatar for J.S.AlKatheeeri

Perhaps specifying a size for the GridBagLayout would help. Also, calling the pack() method before the setVisible(true) might also be useful? Its been awhile since I worked with Swing and I don't have the JRE set up right now on this computer to test, but I believe this is where …

Member Avatar for J.S.AlKatheeeri
0
206
Member Avatar for donlee

If the error message is from the operating system or the JRE, it is likely that the file itself has been corrupted somehow. If the message is coming from a program-generated window, then it is possible that the application itself either has corrupt files or has been programmed to fail …

Member Avatar for dmanw100
0
193
Member Avatar for lethal.b

Every program is, by default, a thread. This thread can spawn other threads (such as classes that extend Thread or implement Runnable in Java). From what you said it sounds like you technically have two threads in your model already. The main program (or whatever produced the button) is a …

Member Avatar for dmanw100
0
119
Member Avatar for sunmania

Using the Scanner class would be the best. You can read each section of the file with it and specify the delimiter to use. Something like this: [CODE]Scanner fileReader = new Scanner("FILENAME.txt"); while(fileReader.hasNext()) { String item = fileReader.next(" "); // Print or store the string, read in the next line …

Member Avatar for dmanw100
0
2K
Member Avatar for waldchr

I believe what you're looking for would be the [URL="http://www.asciitable.com/"]ASCII character codes[/URL].

Member Avatar for Cosmin871
0
638

The End.