7,116 Posted Topics

Member Avatar for Hades80
Member Avatar for kathir100
Member Avatar for jennilyn.frias

Sounds like you may be running your loop on Swing's thread (eg in a listener method). When swing calls one of your methods it doesn't do anything else until your method returns.

Member Avatar for JamesCherrill
0
32
Member Avatar for geek86

Why all that messing about with the path? Why not go straight through like this file = chooser.getSelectedFile(); image = ImageIO.read(file);

Member Avatar for JamesCherrill
0
3K
Member Avatar for harirock
Re: JVM

The JVM provides a standard environment for Java programs to run on, independent of the platform. However, the JVM itself needs to interface with the OS, so there is a different version of the JVM for every OS.

Member Avatar for rotten69
0
128
Member Avatar for hamiltino

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for JamesCherrill
0
431
Member Avatar for rajesh1158

That is the kind of thing that Eclipse plug-ins do, so I expect its not too hard (although I've never actually done it myself). There's loads of technical info for plugin developers on the Eclipse web site, plus you can look at the source code for existing plugins. It's nothing …

Member Avatar for JamesCherrill
0
308
Member Avatar for zeroflee09

Means what it says. The compiler attempts to check all the paths through your code to make sure you always initialise variables before you try to use their values. It has seen that there are some combinations of the if tests where this may be a problem. You fix it …

Member Avatar for zeroflee09
0
307
Member Avatar for abbelylee

Yes, it would make sense for the readFile method to return the data it has read. A 2D array is one sensible option. It's straightforward to create a table that displays a 2D array - all you need is a second array that has the column names. Post what you …

Member Avatar for JamesCherrill
0
118
Member Avatar for phil.robison.5

"inner class" means you have declared one class inside another (bull2Game is declared inside Main). In this case that's probably a mixup with the matching of the { and }

Member Avatar for JamesCherrill
0
264
Member Avatar for Nickquane

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for NormR1
0
517
Member Avatar for kmrudula

Java images are RGB, so you would need to convert, but that doesn't seem too easy... http://en.wikipedia.org/wiki/Lab_color_space#RGB_and_CMYK_conversions

Member Avatar for JamesCherrill
0
45
Member Avatar for hubber92

Please post the actual code that gives the error - the mish-mash above won't do anything - and then post the exact complete content of all error messages - including compiler errors - and line numbers

Member Avatar for hubber92
0
144
Member Avatar for Ideteng

That's a very general question. There are many good tutorials and examples around this subject, so google for suitable tutorials on the web, then come back here if you have specific questions

Member Avatar for JamesCherrill
0
37
Member Avatar for Krishna1991

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for JamesCherrill
0
109
Member Avatar for trishtren

How many integer values were there before and after you added more integer values?

Member Avatar for trishtren
0
193
Member Avatar for prnjn

Other people will have the same problem, and will find this article, so please share yur solution with the rest of the DaniWeb community.

Member Avatar for prnjn
0
3K
Member Avatar for shsh111

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Have you tried Google or Bing?

Member Avatar for SagarSe7en
0
161
Member Avatar for gabz16

leeana. This is a long dead thread. DaniWeb Member Rules include: "Do not hijack old threads by posting a new question as a reply to an old one" http://www.daniweb.com/community/rules Please start your own new thread for your question

Member Avatar for JamesCherrill
0
2K
Member Avatar for serph09

I think that's just a work-in-progress framework, so he can test that part of the code before moving on to doing more exciting things for each char (in which case I thing he is doing *exactly* the right thing).

Member Avatar for JamesCherrill
0
614
Member Avatar for sofien.fkih

You create the file inside your loop, so each row of the results creates a new file and replaces the previous one. Create the file and the Writer before entering the loop and that should work better.

Member Avatar for JamesCherrill
0
171
Member Avatar for Armanious

The easiest way is probably to use Sockets to establish a 2-way communication between the running apps. That also has the advantage that it works exactly the same if one of the apps is moved to a different computer. There are "better" solutions, eg RMI, but they come with a …

Member Avatar for Armanious
0
182
Member Avatar for aabbccbryanmark

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules include: "Do provide evidence of having done some …

Member Avatar for aabbccbryanmark
0
162
Member Avatar for ramel.coletana

Sorry, this is not a personal valet service. DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for neowolfx
0
90
Member Avatar for AireenK

All you need is is to see how long that time is from now, then create a java.util.Timer that will call you back after that time has elapsed. In your callback you can pop up an alert or whatever else.

Member Avatar for JamesCherrill
0
44
Member Avatar for raviaaaa

Why 1.5? - that is also an obsolete version (replaced in 2006). Only the current version (1.7) will protect you with all the latest security updates. class files compiled under earlier versions should execute unmodified under 1.7

Member Avatar for JamesCherrill
0
194
Member Avatar for joejo

@joejo From here there's no way to know if the church story is true, or just an attempt to get sympathy for homework help, but assuming it's true: You have no choice but to go to the church, admit that you were hopelessly optimistic when you agreed to do this …

Member Avatar for Stuugie
0
222
Member Avatar for SagarSe7en

Serious suggestion: work a couple of examples on a sheet of paper writing down everything you do. Then write code to do the same thing.

Member Avatar for NormR1
0
550
Member Avatar for ramel.coletana

Just this once I'll do your Googling for you http://docs.oracle.com/javase/tutorial/java/concepts/index.html Next time do some work yourself before asking for help.

Member Avatar for johhny-marshal
0
102
Member Avatar for collinsislee

Hello yogita. Welcome to DaniWeb, but please read the DaniWeb member rules before posting http://www.daniweb.com/community/rules In particular: Do not hijack old forum threads by posting a new question as a reply to an old one and Do provide evidence of having done some work yourself if posting questions from school …

Member Avatar for JamesCherrill
0
367
Member Avatar for 47pirates

Date objects don't have a format, they just hold a date. The SimpleDateFormat class has easy methods to parse strings like yours into Dates, and to display Dates in yopuir desired format.

Member Avatar for Taywin
0
191
Member Avatar for rithish
Member Avatar for abbelylee

Let's assume that you are going to put the file reading code into a method, eg readDataFrom(File f). In that method all you need to to do is to read the file, split the lines (as Norm said) and add that data to a 2D array. Finally you return the …

Member Avatar for NormR1
0
156
Member Avatar for OsamaJutt

`if(e.getSource()==change.getSelectedIndex())` `e.getSource()` is the object where the event happened `change.getSelectedIndex()` is the line that's currently selected these are two quite different things, and will never be equal. You probabaly want something more like: if(e.getSource()==change) { // use clicked in the change object int selectedLine = change.getSelectedIndex(); // this is the …

Member Avatar for JamesCherrill
0
176
Member Avatar for esy928

You should think about using a jar file to distribute your application. Jars can be "signed" which guarantees that they have not been tampered with. You can check in your program that the signature is OK - it's a little messy, but this discussion has solutions: http://stackoverflow.com/questions/1374170/how-to-verify-a-jar-signed-with-jarsigner-programmatically

Member Avatar for esy928
0
145
Member Avatar for iThaos

You are re-using tempArray. When you add tempArray to data you are adding a reference to tempArray. Because you re-use the same array, every entry in data refers to the same array. Then you reset the contents of tempArray and overwrite with the next row's data. You need to allocate …

Member Avatar for iThaos
0
426
Member Avatar for riahc3

"Later" as in "later in the same run of the program" or "when the program is run again some time later"?

Member Avatar for JamesCherrill
0
1K
Member Avatar for cor.vandijk.779
Member Avatar for lesliebielski

What's the variable "a" for? You use it but never give it a value. What's the boolean "addTicket" for? - What are you saying when you say "addTicket is true"? When/where do you ever update isSuspended? Finally if you are getting a compiler diagnostic about return statements then post the …

Member Avatar for JamesCherrill
0
240
Member Avatar for trishtren

Do you mean `string1.equals(string2)` ? (returns true only if both strings contain exactly the same sequence of characters)

Member Avatar for stultuske
0
232
Member Avatar for kovidd

I say "do a project". It almost doesn't matter what it is as long as it's not too simplistic. Now you have the essential concepts you will learn best by doing.

Member Avatar for JamesCherrill
0
245
Member Avatar for Ashenvale

In your loop (starting line 43) you use ctr to index the % values, increasing it at the end of the loop, but you set it back to zero at the start of every pass thru the loop (line 44), so you only ever use index 0. The newPresident is …

Member Avatar for Ashenvale
0
369
Member Avatar for TarkiB

This question makes no sense. Float values are held in binary, not decimal, and adding a trailing zero after the decimal point makes no difference to any numeric values.

Member Avatar for JamesCherrill
0
441
Member Avatar for anand01

1. use the String matches(Regex) method with a regular expression for whatever you consider to be a letter in whatever languages you need to support. 2. check each char in the String one at a time using Character's isLetter(char) method which knows about non-english characters.

Member Avatar for anand01
0
108
Member Avatar for GlenRogers
Member Avatar for JamesCherrill
0
149
Member Avatar for coroll

For that size of data there's no reason why you would not keep it all in memory - about a megabyte should be enough. You can simply read a text file with all the words into an array of Strings. Searching in memory will be orders of magnitude faster than …

Member Avatar for JamesCherrill
0
192
Member Avatar for freesoft_2000

There are a load of answers in this 2004 zombie thread using Runtime.exec to run an external process, but this was superseded in Java 5 (JDK 1.5) with ProcessBuilder, which is now preferred to Runtime.exec [url]http://www.java-tips.org/java-se-tips/java.util/from-runtime.exec-to-processbuilder.html[/url]

Member Avatar for JamesCherrill
0
2K
Member Avatar for schoolbus11

1. Put all the strings with the fortunes ("yes" etc) into an array. Use a random number as an index into the array to pick one of the strings. 2. Create a boolean tha tells you whether you are currently displaying the 8 or a fortune. Test that in the …

Member Avatar for schoolbus11
0
324
Member Avatar for cmmmm

> The reason why you are getting errors is because you are trying to return a single integer when in your function def you are saying it will return a pointer to an integer (unless Java can actually return arrays, in which case that would be an array). This is …

Member Avatar for JamesCherrill
0
771
Member Avatar for annette_arpana3

You could use two arrays, but that's a pretty messy solution. Java has a HashMap class that lets you create pairs of key/value and it will look up the value from the key for you. This example creates a map with Strings for the key and value, adds a couple …

Member Avatar for annette_arpana3
0
165

The End.