Recommended Answers
Jump to PostPost the code here - don't expect people to go looking for it somewhere else.
Jump to PostYou create a grid layout 3x2 (6 components) then add 17 components to it.
For your eof error put some print statements into the read loop so you can see how many records it's reading, exactly where it hits eof etc.
Jump to PostYou write age as an int - a 32 bit binary value - it won't appear as text, just as 0-4 characters of garbage. You will need a binary file editor to see it properly.
For the eof, let's start with the info that Java already provides. In your catch …
Jump to PostSo let's look at the stack trace, starting at the bottom (earliest call)...
lines 28-7 are Java's event handling getting the button press and calling your actionPerformed.
on line 6 your actionPerformed is seen calling readUTF, which leads to an eof exception.
line 6 also tells us that the particular …
Jump to PostThat code is not the code that you ran to get the exception stack trace. The line numbers are different. Just post to line that was line 125 when you ran the code.
All 21 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.