7,116 Posted Topics

Member Avatar for Abdullah_7

"When I click the save button it shows an error." What is the exact complete error message?

Member Avatar for JamesCherrill
0
188
Member Avatar for Levellous

What's the relationship between the `address` and `addressList` Lists? Are you sure that addressList contains all the entries you expect? Is the size() of address as large as you expect?

Member Avatar for JamesCherrill
0
360
Member Avatar for ali11

Use a `javax.swing.Timer` to call a method that updates the info every 60,000 milliseconds. See the API doc for details

Member Avatar for stultuske
0
149
Member Avatar for TekknoDraykko

As far as I know there are little or no changes to how Sockets or the NIO SocketChannel etc work from Java 7 to Java 8.

Member Avatar for TekknoDraykko
0
102
Member Avatar for spud91

Line 62 is a terrible mistake. You have a problem related to a file being written In the code that writes the file you go out of your way to supress any exceptions and hide/discard any exception messages. You are saying "if anything goes wrong just pretend it didn't and …

Member Avatar for JamesCherrill
0
404
Member Avatar for pars99

You could try combining all those arcs into a single shape that will then fill properly. A `Path2D.Double` may be the best option.

Member Avatar for mKorbel
0
388
Member Avatar for iris91

If you split the para by white space you will get an array of al the words, so each word will have its own array index (ignoring puncuation for the moment!). You may have problems with the subsequent index numbers changing when you split add or remove words

Member Avatar for JamesCherrill
0
392
Member Avatar for divinity02

"does anyone know of a loop that could be repeated so that the players can enter the correct age. I need to created a loop so that when, let say if player one enter the wrong age it can loop back to the started where they can reenter the correct …

Member Avatar for stultuske
0
222
Member Avatar for Mike1986

JLabel does not display multi-line simple text. You could use a JTextArea or somesuch, or you can use simple HTML formatting to display multi-line text in a JLabel

Member Avatar for JamesCherrill
0
471
Member Avatar for vjcagay

Hey! He's entitled to his opinion. (Although his post would have been better if he had supplied some justification for his opinion.)

Member Avatar for vegaseat
-1
4K
Member Avatar for sing1006

You cannot mix Data streams and Readers/Writers - they use completely different data formats. Data sttreams send (binary) data, readers/writers send text. Either use a DataOutputStream to send data to a DataInputStream, or use a PrintWriter to send text to a BufferedReader

Member Avatar for sing1006
0
1K
Member Avatar for janetheath

You are trying to define a method withiout finishing the previous method defintion. You canno define one method inside another method like that.

Member Avatar for JamesCherrill
0
6K
Member Avatar for Curious Gorge

There's a topic for project ideas in the Java section - but the language is irrelevant https://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners

Member Avatar for JamesCherrill
0
104
Member Avatar for gahhon

An abstract class is a class with one or more methods declared abstract (ie the signature is declared, but there is no implementation. Becuase one or more methods are not implemented, it is not possible to create an instance of an abstract class. An abstract class can be extended by …

Member Avatar for JamesCherrill
0
227
Member Avatar for gahhon

You can now use aTask to do anything that's valid for a Task. Later you coiuld change the PracticeTest ofr a FinalTest or any other subclass of Task without breaking any code. A better example: List myList = new ArrayList(); myList has to be a List because of the logic …

Member Avatar for JamesCherrill
0
208
Member Avatar for Robert_34

Looking at the next line in the stack dump, the parseInt was called from line 111, so it is the "Year" tag that has a null value

Member Avatar for JamesCherrill
0
827
Member Avatar for Bharti_1

Why re-invent the wheel? Why not use ObjectOutputStream and ObjectInputStream to write your meeting data as Java objects and read them in the same way? If there's a top-level object that holds the whole list of meetings then you can just write/read that as a single object. Alternatively, if your …

Member Avatar for Bharti_1
0
384
Member Avatar for Pobunjenik

That toggled loop looks to me like you are trying to go "procedural" where you should be event driven. Normally in both client and server you would have a loop that waits for an inbound messages and handles them (updates game state and/or GIU). In the client, GUI events (OK …

Member Avatar for JamesCherrill
0
438
Member Avatar for turntomyleft

Ahhhhh APL what memories! I used APL in IBM in 1969 on an 1130 mini with a golfball typewriter terminal. I had to have my own personal APL character set golfball. I used it to write an assembler for the System 7 real-time mini so we could start to develop …

Member Avatar for vegaseat
0
784
Member Avatar for shahera.arafat

If you need to add events, then the obvious way to start is to create an Event class. It would have start date/time, and date/time, title, location etc as instance variables, with the usual getters and setters and a constructors. You can use GregorianCalendar instances for the start and end …

Member Avatar for shahera.arafat
0
146
Member Avatar for pars99

I think you will have to create a Shape using multiple arcs, quad curves, maybe even cubic curves. Although cubic curves have the potential to construct this with fewer segments, you may find that it's a lot easier to use simpler curves. You may also be able to simplify the …

Member Avatar for JamesCherrill
0
231
Member Avatar for sirlink99

The Character class has a load of methods for dealing with complicated UniCode characters - maybe that's what you need?

Member Avatar for sirlink99
0
418
Member Avatar for divinity02

Sorry, but that code is completely unreadable. Can you try to split it down into some sensible methods... try to divide it so that no if/else block or loop spans more than about a dozen lines. Then indent it all according to normal Java standards.

Member Avatar for rubberman
0
235
Member Avatar for kxjakkk

It's just like counting words, except simpler. Instead of splitting the String into words, you just take each char from the String and count those.

Member Avatar for JamesCherrill
0
311
Member Avatar for Pobunjenik

startRunning creates an infinite nuber of concurrent server threads, each of which tries to open the same server socket. That's the wrong threading strategy. To make things worse, you have that startRunning infinite loop exceuting on the Swing event dispatch thread, so it blocks all GUI activity for ever. You …

Member Avatar for Pobunjenik
0
688
Member Avatar for Melissa_2

Yes, absolutely. Use the `ProcessBuilder` class - Google for API details and tutorials

Member Avatar for JamesCherrill
0
167
Member Avatar for Goldfinch

public void paintComponent(Graphics g) { super.paintComponent(g); g = graphic.getGraphics(); g.drawImage(graphic,0,0,null); } You re-use the `g` variable on the third line here, thus losing your reference to the component's Graphics, so you draw the imge back onto iteself on the fourth line.

Member Avatar for Goldfinch
0
201
Member Avatar for london-G

I guess your ChartFrame is a kind of JFrame - ie a top-level container or window, so you cannot place that inside a lower-level container like JPanel. If you are usimg JFreeChart then you can replace your ChartFrame with a ChartPanel. ChartPanel is a kind of JPanel, and can be …

Member Avatar for JamesCherrill
0
353
Member Avatar for Nuruhee

Line 13 you print the Scanner object `a` The output you see is the description of your scanner object. I guess you wanted to print the user's input, `kakdo`?

Member Avatar for Markland
0
388
Member Avatar for AndroidUser

What is the .exe file? Simply re-installing the latest version usually fixes any out-of-date or incorrect registry settings. Java 1.6 is years out of date, no longer supported, and riddled with un-fixed security problems. Unless you have some very specific requirement for some obsolete Java application, you should update to …

Member Avatar for AndroidUser
0
2K
Member Avatar for kxjakkk

You get the input from the user, but you parse it as an int. Why is that? You have code (lines 14 - 46) that remove a given string from a given file. You can re-package that code as a method, passing the string and the file name as parameters. …

Member Avatar for JamesCherrill
0
458
Member Avatar for scheppy

I see 20 threads there - is that expected? If it's a problem with your code (as opposed to a bug in the lib itself) the it probably relates to your not closing/freeing/terminating something properly (maybe)

Member Avatar for scheppy
0
981
Member Avatar for Shushan_1

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there.

Member Avatar for JerrimePatient
0
3K
Member Avatar for liphoso

No need for the Strings or the switch, classes are Classes in their own right! Class[] carTypes = {Van.class, Cab.class ... }; for ( int i = 0; i < x; i++) { newArray[i] = (Car) carTypes[getRandomIndex()].newInstance(); }

Member Avatar for liphoso
0
216
Member Avatar for Ant695
Member Avatar for Colin_3

If you have an index out of bounds error then the error message will tell you the exact line where the error happened. No need to guess. I have to disagree with Tekkno. Novices may go 10%/90%, but sucessful programmers go more like 40% design, 30% coding, 20% unit/integration testing, …

Member Avatar for TekknoDraykko
0
177
Member Avatar for shayan_doust

Line 31 you declare the parsedUserGuess variable, OK, but you also give it its value by parsing the text field at that point. This happens before the user has been able to type anything, so the result is just 1. You need to perform the parseInt and assign that to …

Member Avatar for TekknoDraykko
0
533
Member Avatar for Niloofar24

I agree. You will need to create a user interface, create a IP server and an IP client, make a network connection, send data by using streams, and do all that in multiple threads. If you are new to Java this is far too much to tackle in one go. …

Member Avatar for JamesCherrill
0
925
Member Avatar for scheppy

Sorry man, the first version looks right to me. Maybe it's OK but there's some other problem that makes it look like its not working? If you post a runnable test program I can check it out on my Macs.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Doogledude123

There's something deeply suspicious about the data redundancy here that makes me unsurprised that your swap method has problems. As I understand it theres a Tile[][] array that says what Tile is in what position, and each Tile has its x,y position as instance variables. Change one and you must …

Member Avatar for JamesCherrill
0
250
Member Avatar for abdurehim

You seem very confused. Do you want someone to give you some code? If so, this is the wrong place. Do you want help to write your own code? If so, what have you done so far and what help do you need? Why did you mark this solved?

Member Avatar for JamesCherrill
0
274
Member Avatar for Doogledude123

Do you just want to shuffle all the Tiles? Put them all in a `List` and call `shuffle()` Then simply re-populate your x,y grid with the Tiles in their shuffled order.

Member Avatar for Doogledude123
0
246
Member Avatar for shahera.arafat

I can't read all that code, but it sounds like you should be using Key Bindings. http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html

Member Avatar for JamesCherrill
0
426
Member Avatar for dead19

That's just a copy of your assignment. Surely you didn't expect anyone to give you the solution? What help EXACTLY do you need? What have you done so far? Read the rules before continuing https://www.daniweb.com/community/rules ps: Spec implies program will NOT stop if total score > 50. And the two …

Member Avatar for JamesCherrill
0
106
Member Avatar for rahulamuu

That message does not correspond to the code you posted, so that's useless. Anyway - check your capitalisation... the method name is random not Random ps: You will get a faster resonse by posting Java questions in the Java forum.

Member Avatar for rahulamuu
0
878
Member Avatar for collin_ola

When you declare a variable its scope is from the immediately preceeding `{` to the immediately following `}`. So your `excel` variable is in scope from line 211 to 213 only. Outside that scope the variable cannot be used. You have to declare variables somewhere where their scope includes all …

Member Avatar for collin_ola
0
4K
Member Avatar for jamnoesblunt

Rather than have a single String that contains the whole dictionary, you need to store and process each dictionary phrase separately. Eg if the phrases are on separate lines you could use Files.readAllLines to get a List of phrases.

Member Avatar for stultuske
0
123
Member Avatar for scheppy

Have you tried redirecting the new process's output stream? There are various options for that (see the API doc). This one looks particularly interesting... public ProcessBuilder inheritIO() Sets the source and destination for subprocess standard I/O to be the same as those of the current Java process.

Member Avatar for scheppy
0
384
Member Avatar for kavitadc

Hi kavitadc - welcome to DaniWeb. Many of our members have English as their second or third language, so we insist that you post in clear complete English, no "text-speak" or funny abbreviations. It's not clear from your post exactly what help you need. Please start again and explain it …

Member Avatar for Slavi
0
122
Member Avatar for Mpradeep

I agree. Plus: Java isn't the language to do it in. C and C++ would be better.

Member Avatar for Slavi
0
106

The End.