7,116 Posted Topics

Member Avatar for wallet123

You should know by now that when there's an exception message we want to know WHICH LINE IS IT ON!

Member Avatar for wallet123
0
351
Member Avatar for wallet123

[This Oracle tutorial](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#combobox) shows how to put a combo box ina JTable - it's exactly the same for a check box.

Member Avatar for JamesCherrill
0
344
Member Avatar for Ankit_8
Member Avatar for pspwxp fan

Your processing is preventing Swing from getting any CPU cycles, so any GUI updates are blocked until your processing finishes. You need to read up on the Swing Event thread and the SwingWorker class. Start here http://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html

Member Avatar for JamesCherrill
0
576
Member Avatar for murali2489

PriorityQueue inherits its toString() from java.util.AbstractCollection, which doesn't know about sort orders. (println uses toString() on all its arguments). If you poll() the elements as intended, you get them in the correct order, eg Integer i; while ((i = pq.poll())!= null) System.out.print(i + " ");

Member Avatar for murali2489
0
4K
Member Avatar for Violet_82

OK!!! 1) Just for simplicity. You can have a GridBagLayout on a JPanel, but there's often less need for sub-panels to achieve your layout than there would be for some other managers. On average its still very common to see multiple JPanels - relating to different logical parts of the …

Member Avatar for Violet_82
0
206
Member Avatar for maricar_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

Member Avatar for JamesCherrill
0
86
Member Avatar for r.nair3456

Also, multithreading isn't just a Java thing. If a language and its libraries don't implement support for multi-threading then they're no use in the real world of software deveopment. Multi-threading is conceptually difficult, and can be very hard to wrap your head around. Java's support for multi-threading is as easy …

Member Avatar for Schol-R-LEA
0
314
Member Avatar for joseph_7

MarieSim seems to have been written in Java, but you can't write MARIE programs in Java, so you probably won't find anyone here who can help. It's whole purpose is to introduce machine-level machine code programming in a highly simplified virtual machine. A very quick Google on "marie programming" lead …

Member Avatar for JamesCherrill
0
162
Member Avatar for Violet_82

Yes, and I would place the buttons as a GridLayout inside a JPanel, so the JFrame has a text field and a JPanel, one above the other. A loop to create the buttons is a good idea. There's no need to have an array of buttons - once created and …

Member Avatar for Violet_82
0
3K
Member Avatar for utkarshsahu

We don't have the specs for CustomPlayer, but most players have a listener interface where you can get a callback when the track has finished playing. That would be the best way to do it. If not, there's loads of stuff on how to use timers, both in the API …

Member Avatar for JamesCherrill
0
1K
Member Avatar for sonam22

For formatted text don't use a JTextArea, use an editor pane or text pane. See http://docs.oracle.com/javase/tutorial/uiswing/components/editorpane.html

Member Avatar for JamesCherrill
0
35
Member Avatar for sk8ergirl

No, not toString for the JList. By default JList calls toString on each object that it displays to get some text to put in the list. You could change toString for your Person class, but that will probably mess up all the other places where it's used. You could write …

Member Avatar for JamesCherrill
0
270
Member Avatar for Aqirulez

Hi, welcome to DaniWeb 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 (which you agreed to …

Member Avatar for stultuske
0
234
Member Avatar for StephenopolousINC

There's a real problem with Scanner's design - so many people fall into this trap. You have some input with an int followed by some text, eg 101 John Doe ... and you try to read it with int num = scanner.nextInt(); String name = scanner.nextLine(); ... and name is …

Member Avatar for StephenopolousINC
0
282
Member Avatar for deolalkar_pooja

> at myapp1.init(myapp1.java:39) tells you its on line 39, ie `add(c4);` the only thing that can be null in that is c4. You declare c4 on line 9, but you never seem to give it a value, so it's null. On line 21 you give c1 a value. On line …

Member Avatar for deolalkar_pooja
0
253
Member Avatar for Violet_82

When it said "Recompile with -Xlint:unchecked for details." that wasn't just to fill in a bit of spare time" Do what it says and you will get a proper error message with details of the problem and the exact place where it was found.

Member Avatar for Violet_82
0
940
Member Avatar for faizlo

They are all variables. Some veriables are "primitives", eg int, float, boolean, char (See Java Language Spec section 4.2 for the complete list, but they alll have names that begin with a lower case letter. All the *classes* in standard Java have names the begin with an upper-case letter). They …

Member Avatar for JamesCherrill
0
210
Member Avatar for sk8ergirl

Java doesn't know what it means for a Person to be "equal" to another Person, unless you define an "equals" method in your person class. If you don't define your own equals then you inherit one from Object - which is just the same as ==, ie is exactly the …

Member Avatar for stultuske
0
137
Member Avatar for Violet_82

The simplest way is to use multiple JPanels to organise the groups of controls. eg Place 3 JPanels in your JFrame, flowing left to right. In the first one add the two checkboxes, in the second add the x,y labels and fields, in the third add the buttons. In each …

Member Avatar for Phaelax
0
463
Member Avatar for alansoeric

The error message tells you exactly what the error was and the exact line where the error occurred. That would be very useful information to share.

Member Avatar for stultuske
0
192
Member Avatar for pspwxp fan
Member Avatar for Derek_4

You can use a String array to hold all the previous answers and print them later. An ArrayList of Strings would be even better, if you have got that far in your Java course.

Member Avatar for Derek_4
0
295
Member Avatar for Dinesh_9

Opening tags have stuff between `less than` and `greater than` symbols. Closing tags ditto, but the first thing after the opening `less than` is a `forward slash`. That should be enough for you to tell which is which and process or ignore them accordingly.

Member Avatar for Dinesh_9
0
701
Member Avatar for YumnaZia

13: java.lang.NullPointerException 14: at DatabaseManager.getFaculty(DatabaseManager.java:14) would be a good place to start looking...

Member Avatar for JamesCherrill
0
332
Member Avatar for aszhhtzz

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 Muni123
0
223
Member Avatar for Anushree_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 JamesCherrill
0
67
Member Avatar for tingwong

Card swap = deck[k]; deck[N] = deck[k]; deck[k] = deck[N]; Here's a problem. You don't use "swap", you just put the original entry back.

Member Avatar for cael13
0
1K
Member Avatar for asaidi

NetBeans is the "standard" Java development environment, and includes D&D window building etc. But stultuske is right - you may learn how to D&D but you won't learn how windows are built and operate in Java. Then, when you want to do something just a bit more complex, you'll be …

Member Avatar for JamesCherrill
0
150
Member Avatar for XTMercenary

No need to delete - this solution may be useful to someone else. I've marked it "solved" J

Member Avatar for JamesCherrill
0
150
Member Avatar for Dinesh_9
Member Avatar for JamesCherrill
0
226
Member Avatar for Ritesh_4

The Date class was there in the very first Javas, but it was a poor piece of design - it doesn't handle time zones etc, wich makes it essentially useless for anything real. It was replaced by the Calendar interface, which has an implementation in the GregorianCalendar class. This is …

Member Avatar for Ritesh_4
0
3K
Member Avatar for Patrick_3
Member Avatar for JamesCherrill
0
763
Member Avatar for rikje.van.driessche

Welcome to DaniWeb. "get an error here" tells us nothing. If you have a compiler or runtime error message please post the complete message plus the actual code it refers to. If your code is giving an incorrect result explain what result you get and what the correct result should …

Member Avatar for rikje.van.driessche
0
205
Member Avatar for xIllustrated

You didn't post the requirements definition, so we have to guess exactly what you were asked to do, but ... at a guess ... Either: Your expenses need to have a month number associated with them ( a third array? or: Each month should have its own arrays of items …

Member Avatar for JamesCherrill
0
86
Member Avatar for stikku

The question is pretty vague, but seems to be in two parts: How to display random image? Have an array containing all the file names and pick a value from it using a random integer. You can get an array of all the files with a particular extension in a …

Member Avatar for JamesCherrill
0
86
Member Avatar for cwarn23

Maybe its a problem with the byte arithmetic? The RGB byte values are unsigned (0 to +255), but Java bytes are signed (-128 to +127). You may need to do some masking (ANDing with hex FF) to stop the first bit being propogated as a sign bit when you convert …

Member Avatar for JamesCherrill
0
261
Member Avatar for nvnq

You should have created a "get" method in your machine class(es) to allow other classes to access the x,y coords. (If you have designed your classes to be immutable, then it's easier to declare the instance variables as `public final` to make them accessible.) How have you created you "master" …

Member Avatar for nvnq
0
189
Member Avatar for Violet_82

You can work with `setMinimumSize` to have a minimum height and width, (and `pack()`, of course), but that gives you no control over the width or where it will flow onto a new line. `setMaximumSize` may allow you to force it onto a new line, but the size is in …

Member Avatar for Violet_82
0
167
Member Avatar for Mkaveli

Sorry, it looks like you may be out of luck. I don't think there are many JavaFX users active in this forum (yet). Still, don't give up too soon - people are still coming back after the New Year.

Member Avatar for JamesCherrill
0
204
Member Avatar for ZixCo

This was already covered in your previous thread. You use a Layout Manager. See http://docs.oracle.com/javase/tutorial/uiswing/layout/using.html and http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

Member Avatar for JamesCherrill
0
213
Member Avatar for ZixCo

You *can* set the layout manager for the container to `null`, then use `setBounds` to set the size and position of your label in pixels. However, if you do it's going to look very silly when someone runs your code on a screen with "retina" resolution, or even just on …

Member Avatar for ZixCo
0
413
Member Avatar for tbuchli

You have created Die as an inner class, but there's no reason to do that. I would move the declaration of Die to outside the JavaMonopoly class.

Member Avatar for JamesCherrill
0
3K
Member Avatar for Zachary_1

It's a classic double-declaration problem. YOu have created two different "contentPane" variables. 13 protected JPanel contentPane; this is the contentPane variable that you use in the actionPeformed and which is initially null, and which is never initialised by you 26 JPanel contentPane = new JPanel(); this is the local variable …

Member Avatar for stultuske
0
332
Member Avatar for sankubha

One way is for the app to link to a server that you control somewhere to check the trial licence period.

Member Avatar for stultuske
0
121
Member Avatar for mikewyatt

ByteStreams looks like a Google Java class. I haven't tried this, but maybe you could try `ImageIO.read(blob2.getBinaryStream())` to get the image then pass that to an ImageIcon constructor.

Member Avatar for mKorbel
0
258
Member Avatar for Allison_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 masijade
-2
144
Member Avatar for phoenix_2000

Where you create them and where you store them are two different things. It may be best for the Game class to have responsibility for creating everything, including Items, but then immediately adding them to the appropriate Inventory. Coupling is always a bit of a question in respect of the …

Member Avatar for phoenix_2000
0
188
Member Avatar for Ersin

http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq

Member Avatar for JamesCherrill
0
146
Member Avatar for Vickyurs86

Hi Vicky, welcome to DaniWeb. Start here: http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq

Member Avatar for ObSys
0
143

The End.