7,116 Posted Topics

Member Avatar for Meghan_1

`bookVersion = pub.setVersion(bookVersion);` your `set` methods are void, so they don't return anything, so there's nothing that can be assigned to `bookVersion`. It's traditional for `set` methods to be void, but latest practice is for them to return `this` so you can chain them together (so-called "fluent interface"). Just a …

Member Avatar for JamesCherrill
0
767
Member Avatar for shiv_5

Hello Shiv. Welcome to DaniWeb. Your help will be very welcome.

Member Avatar for JamesCherrill
0
164
Member Avatar for Curious Gorge

rproffitt: Sorry, but it does look to me like you have missed Gorge's point. He has got a working algorithm, but has a specific problem with intersections that have 4 (or more?) exits. Sorry if I have misunderstood your replies. To me it looks like an artifact of the details …

Member Avatar for JamesCherrill
0
664
Member Avatar for John_165

Just a guess: Its line 12 that's the problem. `rows` is the number of rows, so valid values for the second parameter should be 0 to (rows-1)

Member Avatar for JamesCherrill
0
1K
Member Avatar for cainam29

Another observation is that firstname is so far from unique that it's completely useless on its own as a key. Just wait until you have 100k users and you search on "John". I suggest you go back a step and avoid this ever happening, eg default the name sfields in …

Member Avatar for AndrisP
0
274
Member Avatar for patk570
Member Avatar for RAHEEL_3

First, selecting a shape by clicking inside it... the `contains` method comes from `Shape`, so assuming you have some kind of list of the existing shapes you can iterate through that to see which Shape contains the mouse pressed point (if you allow overlapping shapes then there may be more …

Member Avatar for JamesCherrill
0
518
Member Avatar for Glenda C.
Member Avatar for Glenda C.
0
183
Member Avatar for John_176

> Who's UI? Don't worry - it's a bit of an ongoing in-joke here at the moment. I've sent Dani a PM on your behalf to let her know you want to get in touch. JC

Member Avatar for Dani
0
618
Member Avatar for skitband

Hi Darren Please start your own new thread for your question - do not hijack other people's old threads. Don't forget to ask clearly what help you need, and show what you have done so far. Someone will help you.

Member Avatar for JamesCherrill
0
559
Member Avatar for RAHEEL_3

Normally for an undo you would get rid of the last thing you added - ie remove the last Triangle, Rectangle, or Circle from its corresponding list, then redraw. Your code deletes all the Rectangles in the list - regardless of how many there are, and regardless of whether the …

Member Avatar for JamesCherrill
0
1K
Member Avatar for RAHEEL_3

Because you add the triangle to `triangles` every time mouseDragged is called, so you end up with it repeated many times. You can do something like: mouse pressed: create a new Triangle object mouse dragged: update the Triangle object mouse released: add the Triangle object to `triangles` If you want …

Member Avatar for RAHEEL_3
0
851
Member Avatar for rproffitt

We bought a new Renault Zoe at the end of last year and are glad that we did. It has a realistic range of 250km after an overnight charge which covers almost all our driving needs. We kept our big old Citroen C4 Picasso for those occasions where we needed …

Member Avatar for JamesCherrill
1
559
Member Avatar for RAHEEL_3

That's because you don't add the new triangle to `triangles` until the mouse is released. Upside down *may* be because y coordinates start at 0 at the top and increase downwards.

Member Avatar for RAHEEL_3
0
1K
Member Avatar for Gablin

`println` works by calling `toString()` on each of its arguments in order to get something printable. All classes inherit a `toString()` from `Object`, but all that does is to return the class and hash of the object. Thats what line 21 above will do. You should always override toString in …

Member Avatar for JamesCherrill
0
169
Member Avatar for Sibuns

If this is a "small business at home" then you are over-engineering this to a rdiculous extent. Who are the "receptor" and the "worker" - mom? dad? (not to mention anyone who actually changes tyres!) Just how big is your "home" that you need QR codes and an SQL database …

Member Avatar for Sibuns
0
482
Member Avatar for Reginald Xavier

Where you have multiple forms ("views") that need to share data (a "model") you can use Model-View-Controller (MVC) architecture. In simple cases you can ignore the controller and just have a model class or classes that have the data and application logic and view classes that display or input data …

Member Avatar for tinstaafl
0
292
Member Avatar for UI

The tragedy here is that UI is obviously a highly intelligent and articulate person, but those attributes are being criminally wasted trolling an irrelevant web site when he should be building a demo or proof of concept for his ideas and seeking partners to bring them to fruition. OK, maybe …

Member Avatar for diafol
-5
811
Member Avatar for Saboor880

> I have given a space of %30s between every field That's not how it works. The width spec is the minimum width to use for the field, not the space between fields. Your format is `"%s %30s %30s %30s"` That means the first item is printed a String with …

Member Avatar for rproffitt
0
2K
Member Avatar for John_165

You have made the fundamental mistake of using a null Layout Manager. By hard-coding pixel coordinates you eliminate any portability to computers with screen resolutions or fonts different from yours. How this is going to play with using a GridBagLayout at the same time is anybody's guess. Line 142 - …

Member Avatar for JamesCherrill
0
917
Member Avatar for UI

I just banned UI for repeated unrepentant irrelevant trolling of valued DaiWeb members. Maybe that will cost me my Moderator badge, but someone had to do something. JC Update: happygeek disagrees. He's an admin and has overridden my ban (as is his right). It's out of my hands now <sigh …

Member Avatar for diafol
-5
671
Member Avatar for UI

fpru: Forensic Psychiatric Rehabilitation Unit, according to Google. Appropriate?

Member Avatar for JamesCherrill
0
432
Member Avatar for Obbie_1

Maybe because you have four ? parameters but you set only 2 of them???

Member Avatar for Mr.M
0
223
Member Avatar for Talha_11
Re: Java

Java is HUGE in scope - I doubt that any Java developer ever knows all its aspects. Have a look at Oracle's Java tutorials - in my opinion the best and only ones worth working with. The overview is [here](https://docs.oracle.com/javase/tutorial/). You definitly need to be familiar with all the stuff …

Member Avatar for sathish kumar_1
0
245
Member Avatar for tarun_6

It all depends on how well your original app is structured and documented If you have designed, modularised, and layered it well then you should be able to re-use almost everythinhg except the swing GUI code (ordinary Java is pretty compatible berween SE and Android). Go back to the design …

Member Avatar for tarun_6
0
2K
Member Avatar for Andres_5

> Still running 30 minutes already... Unless you have some horrendous recursive algorithm, anything more than a few seconds is wrong. Sounds like you have an infinite loop.

Member Avatar for JamesCherrill
0
631
Member Avatar for rithish

Your compile error is because "ActionListener(){} must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)" and you implemented actionperformed(ActionEvent) (Java is case-sensitive)

Member Avatar for ajax_1
0
2K
Member Avatar for Plinth

If you are doing a B. Tech. then doesn't that include some element of programming? In which case what language does the first such class use?

Member Avatar for diafol
0
512
Member Avatar for UI
Member Avatar for Brian_28

I use Opera's as well for browsing, NordVPN for torrenting, geo-fence avoidance etc

Member Avatar for gentlemedia
-1
327
Member Avatar for Curious Gorge

> I have some idea based on prior research that I need to leave my superclass methods as stubs. No, that's wrong. If you create a method in a subclass that has the same signature (name, return type, parameter types) as a method in the superclass then that's an override. …

Member Avatar for Curious Gorge
0
373
Member Avatar for Stefce
Member Avatar for Damhart
0
458
Member Avatar for jkon

Learning/playing guitar. I've been able to strum along with sing-song stuff since I was a teenager, but now I have more time I'm learning to play proper Jazz guitar. It's really hard, but it does give me a perfect excuse to buy all kinds of super gear... guitars, amps , …

Member Avatar for Kevin_1
0
361
Member Avatar for John_165

There's an active discussion ongoing in S.O. for this question, so there's no need to reply here until/unless OP comes back first.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Payge

A perfctly good suggestion, but it would be simpler to let the array elements default to zero, then you wouldn't need to initialise it or add 1 at the end!

Member Avatar for JamesCherrill
0
196
Member Avatar for jaelle

> i haven't figured out how to read the file starting from the third line Just read and discard the first two lines.

Member Avatar for JamesCherrill
0
2K
Member Avatar for sid_4

Read this https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question then start again with all the required content.

Member Avatar for JamesCherrill
0
100
Member Avatar for rubina_3
Member Avatar for rubina_3
0
1K
Member Avatar for SkateX

26: `double apr = 0;` 30: `HNUnit4Ch13Investor.setInterestRate(apr); ` // sets rate to zero 33: `apr = input.nextDouble();` // this is the real rate, but too late. You never use it

Member Avatar for SkateX
0
907
Member Avatar for jkon

I agree you're not going to get rich on up-front pricing, but in-app purchases are a different animal - all you need is a couple of thousand $1 purchases to get your investment back. So maybe your marketing with bloggers etc will fail and nobody will ever hear of, let …

Member Avatar for jkon
1
593
Member Avatar for wilsonz91

Hi Lior You have just joined an old thread about Java programming. If you want relevant answers, please start a new thread of your own, explain what help you want, and tag it with the appropriate language.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Khushali_1

https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question

Member Avatar for rproffitt
0
305
Member Avatar for Nathan_6

The exceptions are referring to a probable problem in `CoinCollection.CoinCategory compare:` Maybe a closer look at that code is needed?

Member Avatar for JamesCherrill
0
767
Member Avatar for MO13
Member Avatar for ddanbe
0
135
Member Avatar for Eddy_2

1. Read this before posting again https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question 2. We only help people who are making some kind of effort themselves. All you did was to violate your teacher's copyright by posting the whole assignment without any attempt to show any work or even ask a question. 3. No, we are …

Member Avatar for JamesCherrill
0
395
Member Avatar for diafol

If someone has code or a question re Java I'd be happy to see it no matter where they posted it. When we had specific forums for specific topics we didn't have this problem. Now all we have is tumbleweed blowing and settling at random. :(

Member Avatar for Reverend Jim
5
3K
Member Avatar for Saboor880

This is why Swing has Layout Managers. You start with the components (text fields, drop-down lists, whatever) which Java sizes to fit the text in them - nb this depends on the font you are using and the screen resolution. You use a layout manager to add these to the …

Member Avatar for JamesCherrill
0
4K
Member Avatar for Adm666

Going back to Kernighan & Ritchie... > An array name is a pointer expression ... a reference to an array is converted by the compiler to a pointer to the beginning of the array ... a reference to a[i] can also be written as *(a+i) Obviously this implies that the …

Member Avatar for pty
0
356
Member Avatar for Saboor880

Wow. That's really weird. What happens for 17-5-2017, or when you change the end date?

Member Avatar for Saboor880
0
225
Member Avatar for Saboor880

Your code says: create some fields open a (modal) message dialog ... (modal dialog waits for user to click OK or close etc) set store name so that's why it sets the store name when you close the dialog If you only want it to update on the save button, …

Member Avatar for Saboor880
0
1K

The End.