7,116 Posted Topics

Member Avatar for kraykezia

1. Is the setIcon being executed? (put a print starement just before it to confirm) 2. Is the label big enough to display the icon? 3. Is the ImageIcon being read properly - new ImageIcon throws no exceptions and issues no errors if it fails, it just gives you anempty …

Member Avatar for JamesCherrill
0
120
Member Avatar for john.mcdonnell.777

> I cant get the paint part or the programme to work properly That's nowhere near enough info. Exact problem please.

Member Avatar for JamesCherrill
0
248
Member Avatar for manish.mehta

Yes, it is entirely possible. Sorry Nutster, your answer is completely wrong. Java has the ability to run external processes. In older versions of Java it used the Runtime class, modern versions use ProcessBuilder. You can start an external process and pipe its standard input and output and error streams …

Member Avatar for Nutster
0
759
Member Avatar for dragonofspam

It's hard to know where to start with so little info about the problem. You say you "cannot get the radio buttons to work". What exactly does that mean? They don't appear, they don't change when you click them, your listener isn't called, your listener is called but doesn't do …

Member Avatar for dragonofspam
0
3K
Member Avatar for Stupid.Widget

Yes, you could. But you (and anyone reading the code) would need to know what each column in the array represented, whereas if they were different 1D arrays then their name would tell you what they were. For this reason, I think a 2D array is a bad idea.

Member Avatar for JamesCherrill
0
225
Member Avatar for Valiantangel

Line 8 seems to be the start of a method definition, but it's inside another method definition (starting line 5), which is illegal. Lin 18 you have name followed by type (eg i int) when it should be the other way round (eg int i)

Member Avatar for NormR1
0
182
Member Avatar for Simes

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" "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 and show …

Member Avatar for JamesCherrill
0
255
Member Avatar for r0n

JTable's getValueAt(int row, int column) method returns the value in any cell, so you can loop thru any col you like getting the values and adding them up.

Member Avatar for JamesCherrill
0
2K
Member Avatar for 47pirates

A LayoutManager is how you do it - looks like there's some (small) error in how you have chosen the parameters, that's all. Are you specifying where in the layout the panels should be added? If you just add them they both go in the centre. ps: this is a …

Member Avatar for JamesCherrill
0
198
Member Avatar for scarletfire

public void printBackward(int n) ... addLast(list1); printBackward(); count --; Despite the missing parameter that looks like an attempt at recursion to me :)

Member Avatar for JamesCherrill
0
209
Member Avatar for Yarra

You will need to put your images into the jar file. See this recent thread: http://www.daniweb.com/software-development/java/threads/431552/jar-problem-in-pictures

Member Avatar for Justinvzepeda
0
293
Member Avatar for heenakashyap

You seem to be asking for two things: 1. Make the table wide enough to show all the text 2. Make the table fit in the frame without scrolling You can't have both when the text is long, so what is your *single* requirement?

Member Avatar for heenakashyap
0
164
Member Avatar for rajesh1158

What do you want to happen in the second launch if it discovers that there is already an open window? Just exit? Request focus for the existing window and exit? Continue executing without a window and communicate somehow with the existing window? Something else (if so what)?

Member Avatar for bibiki
0
682
Member Avatar for wheels031799

This is the Java forum; your code is not Java. Is it JavaScript? If so there's a forum for that http://www.daniweb.com/web-development/javascript-dhtml-ajax/117

Member Avatar for wheels031799
0
159
Member Avatar for mia16

You have code to track the Rectangle defined by the mouse drag operation. I haven't checked that, but you also clear that Rectangle when the mouse is released, so then you are left with nothing. When the mouse is released, instead of clearing the variable, you can use that selection …

Member Avatar for mia16
0
202
Member Avatar for rahul.ch

The {} in this context define a literal array, as in int a = 1; int[] b = {1,2,3}; int[][] c = {{1,2,3},{4.5.6}}; // 2x3 "2D" array (array of arrays) so `{{1}}` defines a 2D array 1 row, 1 column, containing the single value 1. `{{1}}[0]` selects the first element …

Member Avatar for rahul.ch
0
161
Member Avatar for mikewyatt

Mike. That's a very big question, and I doubt that anyone has the time to write a new document covering all those topics. You'll find loads of stuff on the web for beginners. Please chekc that out first, then come back with specific questions. J

Member Avatar for mikewyatt
0
230
Member Avatar for Cragsterboy

That's a queue of ints, where generics won't do anything for you. But suppose you have the same thing but you want to store any kind of info. Before generics you would make everything an Object, eg `private Object[] items = new Object[5];` Then if you wanted to store Strings …

Member Avatar for Taywin
0
204
Member Avatar for shanki himanshu

> i have to define compareTo method itself? > isnt it inbuilt function? Node is a class that you have created, so there's no way Java can know how you want to compare or sort its instances. Eg for a Person class you may want to compare/sort by family name/given …

Member Avatar for JamesCherrill
0
154
Member Avatar for Krokcy

The fact that it works on localhost does seem to suggest a network problem such as firewall, but your code doesn't show your exception handling. Do you catch and `printStackTrace()` all possible exceptions?

Member Avatar for Krokcy
0
287
Member Avatar for wiliams.kikert

Your puzzle is defined in the String INITIAL_BOARD, which is hard-coded, but it would be easy to read those 9 lines of text from a text file instead. Then you can have any number of puzzles by just creating new files in a text editor.

Member Avatar for Taywin
0
314
Member Avatar for ratatat

No time to read the whole code now, but iut seems setcbo is called to update the cb after the delete, but in setcbo I can't see where you delete the original contents - mabe your updated stuff is just being added on the end?

Member Avatar for JamesCherrill
0
184
Member Avatar for lbgladson

Hi stultuske. Mimi seems to have edited his/her post out, so your comment is left with nothing to refer to. With your agreement I'll delete both posts completely OK?

Member Avatar for NormR1
0
2K
Member Avatar for ezekel

Norm's answer was correct up to Java 1,5 Since then boxing and unboxing casts (ie between primitives and the appropriate wrapper class, eg char and Character) are explicitly defined and allowed in Java language spec: > 5.5 Casting Conversion > Casting conversion is applied to the operand of a cast …

Member Avatar for ezekel
0
589
Member Avatar for psy.blast

"won't work" tells us nothing. Next time post the *complete* text of your error messages. Anyway, your variables daily,weekly,quaterly,bianually,yearly are not initialised.

Member Avatar for steph7
0
249
Member Avatar for 47pirates

Assuming you have a JRE on the target machine you just have to copy the jar onto it and double-click the jar for your program to execute. Do you have any resources outside your jar that the program needs to run (eg database)?

Member Avatar for 47pirates
0
201
Member Avatar for champmanking

How often do you call that update method, and from where (thread/loop/timer?)? Do you really keep adding key listeners every time you update the position?

Member Avatar for champmanking
0
388
Member Avatar for HelloMe

You havr a nunber of options - redraw ther background is one, put the robot in it's own swing component is another. [This tutorial](http://docs.oracle.com/javase/tutorial/uiswing/painting/index.html) is essential reading, not too long, and will give you the info you need.

Member Avatar for HelloMe
0
199
Member Avatar for olive.ventura

Pseudo code can be a useful tool for explaining algorithms etc, but by doing that you have still deprived the OP of the chance to learn how to solve the logical problem for themselves. Follow Norm's frequent approach of getting the OP to do it by hand on a piece …

Member Avatar for stultuske
0
133
Member Avatar for slim.helu.92

A agree with both previous posts. If you are an "expert" Java developer a good IDE can give you much higher productivity, but for a learner they just add complexity and confusion.

Member Avatar for peter_budo
0
175
Member Avatar for Helmyano

Don't worry, you are not violating any rules! In Eclipse select your project, then export... from the File menu That displays a "Choose export destination." dialog from which you chose Java/Runable Jar, which takes you (first time) into a new Jar wizard. YOu can save your jar settings back into …

Member Avatar for Helmyano
0
155
Member Avatar for Banderson

1. This is a very old dead thread. If you need help, start a new thread of your own. 2. This thread already contains enough information for you to get started. Have a go, make some effort, and if you get stuck explain what you have done so far and …

Member Avatar for JamesCherrill
0
323
Member Avatar for donjusko

I have no idea what this means, but I do know that someone in "Executive Management" should have better communication skills. What exactly is it you "want", and why do you think anyone is just going to give it to you?

Member Avatar for JamesCherrill
0
110
Member Avatar for turt2live

Provide an example: eg I have an array {1,2,3} that needs to be "extended" to length 8. What should the result look like?

Member Avatar for JamesCherrill
0
182
Member Avatar for 2concussions

A [][] array is an array of arrrays. First you need to initialise the first/outer array, then you need to initialise the inner/second arrays, although you can do both at once provided all the inner arrays are the same length eg` int[][] blocklist = new int[6][3]` Your code just initialised …

Member Avatar for NormR1
0
298
Member Avatar for rajhans

DaniWeb Member Rules include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" [url]http://www.daniweb.com/forums/faq.php?faq=daniweb_policies[/url]

Member Avatar for JamesCherrill
0
163
Member Avatar for phoenix_2000

You don't say which action listener you are talking about - the empty one or the not implemented one. And what exactly does "keybindings fail" mean? ps Don't use `System.out.println(e.getMessage());` , use ` e.printStackTrace();` instead so you can see where the error happened as well as what it was

Member Avatar for phoenix_2000
0
548
Member Avatar for kenth21v

There are 3 "versions" of Java - ME, SE, EE ME is for phones etc. SE is the ordinary desktop version. EE is SE plus stuff for entrprise-scale applications (big web servers & databases etc). As a "home" user you would normally go for SE. Java FX is an add-on …

Member Avatar for kenth21v
0
236
Member Avatar for Andyjava

You can add an item to a JComboBox by using its addItem method, eg `myComboBox.addItem(myTextField.getText());` You can repeat that for both combos to add the item to both.

Member Avatar for Andyjava
0
753
Member Avatar for DrEinstein

If this is a Swing app that needs its GUI refreshed every second then I would advise a Timer rather than doing your own thread. (Either will work, but a timer is less likely to give you problems.) Have a look at javax.swing.Timer You create one that runs every 1000 …

Member Avatar for DrEinstein
0
143
Member Avatar for trishtren

Since Java does not a 32 bit unsigned data type the "right" answer to this depends on what you want to use it for. Is this for writing/reading compatible files? If the php version is a 32 bit positive integer then a Java long with the same value will have …

Member Avatar for keith.pastorek
0
1K
Member Avatar for phsims

At a quick look it seems you may not be clearing the Graphics before drawing in the new position, so the old drawing in still there. ps If possible you should update your AWT components to the Swing equivalents, if only to get double-buffering as standard so you can simplify …

Member Avatar for JamesCherrill
0
206
Member Avatar for vivekanand.rai.31

AFAIK there isn't a calendar GUI component in the standard Java API. You will find some proprietary ones on the web, but most are not free.

Member Avatar for softswing
0
151
Member Avatar for buzmay

> if (option == "F" || option == "f") Here's your problem. == tests for two objects being exactly the same object, but option is something you just read from the scanner, and "F" is a String created at compile time - they are two different objects, so the == …

Member Avatar for JamesCherrill
0
178
Member Avatar for kb2k8

The Math.pow method simply takes two parameters and raises the first to the power of thesecond, ie `a^b` in maths translates to `Math.pow(a,b)` in Java

Member Avatar for kb2k8
0
145
Member Avatar for Johannady2

DrEinstein - please wrap your Einstein-sized intellect around the fact the OP said "I am studying for our final exam tomorrow." and that was 2 months ago. Your hope that "I helped at least a bit" is unrealistic. Please check the dates of posts before replying.

Member Avatar for DrEinstein
0
315
Member Avatar for rahul.ch

Java Language Spec says: > 5.3 Method Invocation Conversion > Method invocation conversion is applied to each argument value in a method > or constructor invocation (§8.8.7.1, §15.9, §15.12): the type of the argument > expression must be converted to the type of the corresponding parameter. > Method invocation contexts …

Member Avatar for JamesCherrill
0
208
Member Avatar for chotep

> i have to post it to have this kind of style of coding and printscreen it for our project So you are just posting to this topic so you can get your code nicely formatted for your own use? You have no need for anyone's participation, nor do you …

Member Avatar for chotep
0
171
Member Avatar for wilddrummer

The key thing that you have to do first is to replace all those b1 - b48 variables with an array - then yhou'll be able to pick one at random, plus your code will be a lot lot shorter because you can replace each block of 48 almost-identical lines …

Member Avatar for NormR1
0
235
Member Avatar for kathir100

When your object has no remaining references it can be garbage collected. Because you have no remaining references there is no way ever to get it again (excluding very technical/obscure stuff with garbage collection internals). As Norm says Strings are highly optimised in Java, so depending on how "asd" is …

Member Avatar for JamesCherrill
0
256

The End.