7,116 Posted Topics

Member Avatar for Pradipnikam

"Executable" jars are not executable in the same sense as a .exe They are just a data repository, containing .class files etc, which must be processed by a java runtime executable (java.exe or javaw.exe).

Member Avatar for JamesCherrill
-3
109
Member Avatar for evan.winstead.7
Member Avatar for JamesCherrill
0
128
Member Avatar for PratikM

OK, Java may be overkill for this app, but if your intention is to learn/practice some Java then... Start with the "business model" - the classes that will model the employees, sheets graded or whatever. The work upwards from there to the user interface, and downwards to the database (JavaDB …

Member Avatar for somjit{}
0
183
Member Avatar for PratikM

> say I have user A and want to be able to add some information (such as his age) about him, would I have to create another arraylist You can do that, but you will find it hard to keep the two arraylists synchronised (eg, suppose you want to sort …

Member Avatar for JamesCherrill
0
485
Member Avatar for Naushad9045

Forget the Java program for now. Try calculating the subordinate functions by hand with a pencil and paper. Think about how you did that. This will give you the logic you need. Now try to write that in Java.

Member Avatar for JamesCherrill
0
153
Member Avatar for durgesh1

JTable has methods to `addColumn` and `removeColumn` which affect the visible table (but do not change the underlying table model).

Member Avatar for JamesCherrill
0
71
Member Avatar for durgesh1

YOu can use a CardLayout to swap between different JPanels in a JFrame http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html#card

Member Avatar for JamesCherrill
0
265
Member Avatar for deej_uptheowls
Member Avatar for lena1990

You can use a java.util.Timer When you receive anything from the user, cancel any existing Timer and start a new one with a 2 hour delay. If the Timer's TimerTask ever runs it means 2 hours have expired without any input, so it can close the connection.

Member Avatar for JamesCherrill
0
208
Member Avatar for cool_zephyr

Have a look at the URLDecoder class http://docs.oracle.com/javase/6/docs/api/java/net/URLDecoder.html

Member Avatar for cool_zephyr
0
695
Member Avatar for akhilchandranms

You can sleep the current thread by using Thread's sleep method http://docs.oracle.com/javase/6/docs/api/java/lang/Thread.html#sleep%28long%29 ps: I assume you know that your constructor will loop recursively until you run out of memory?

Member Avatar for JamesCherrill
0
309
Member Avatar for nira9

http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners

Member Avatar for JamesCherrill
0
54
Member Avatar for saeef007
Re: Help

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others here. There are lots of people here who will freely give their time to help you become the best Java …

Member Avatar for nira9
-2
110
Member Avatar for noel9

http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners

Member Avatar for JamesCherrill
0
102
Member Avatar for jagvllead

How are you running the program? In particular, if you run it with javaw.exe then there is no console. If so, run it with java.exe instead.

Member Avatar for JamesCherrill
0
1K
Member Avatar for RinzLove

That's not Java. Either re-post in the correct forum or let me know what language it is and I'll move it for you.

Member Avatar for JamesCherrill
0
202
Member Avatar for durgesh1
Member Avatar for Rampee

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
124
Member Avatar for moone009

The "Java" way to do this is to create a tiny class with members for name, id, date. Then use the data to create one instance of that class for each line in the input file. Store those in an ArrayList, then sort as per the previous two posts. Because …

Member Avatar for JamesCherrill
0
195
Member Avatar for MasterHacker110

There's no problem to search all the files names in a folder, or in opening a docx file once you've got it (assuming the machine has Word installed). I wonder if you really need the power (ie complexity/difficulty) of Java to do this - there are probably simpler tools to …

Member Avatar for MasterHacker110
0
178
Member Avatar for laguardian

You don't have any value for teamName - it's declared but never initialised. Presumably you intend at some stage to read it from the scanner, but for step-by-step testing (which, by the way is a VERY good thing to do) you could simply give it some temporary sensible value. Once …

Member Avatar for somjit{}
0
140
Member Avatar for bob.henry.1884

bob.henry: The first thing to learn here is "never just copy code that someone else has given you". No matter how well-intended they may be, and no matter how good the code is, you won't learn much. Maybe phorce could use his/her time now to help you learn how to …

Member Avatar for bob.henry.1884
0
252
Member Avatar for dalawh

Why not just *Enum* (This is the common base class of all Java language enumeration types)? No need for generics.

Member Avatar for JamesCherrill
0
807
Member Avatar for sankubha

For mp3 files javazoom's javalayer is a popular choice: http://www.javazoom.net/javalayer/javalayer.html (ps: I have no connection, commercial or otherwise, with javazoom.)

Member Avatar for JamesCherrill
0
397
Member Avatar for murali2489

There are some simple layout managers, but sooner or later you want to get more precision and control than they offer. That's when it's time to get into GridBagLayout. Yes, it's intimidating at first with so many options, but that's what gives it it power. The layout you described (including …

Member Avatar for murali2489
0
257
Member Avatar for crestaldin

If you really must post an answer to a 6 year old thread, please make more of an effort to post decent code. Starting a line 2 (ignores Java naming standards), continuing with line 4 (throws exception from main instead of handling it), to line 6 (a pile of cryptic …

Member Avatar for JamesCherrill
0
433
Member Avatar for andre.gartner.56

Lines 13-15 look like a method definition, but they are right in the middle of an if inside another method. That has baffled the compiler and is the source of all three errors. Remember you can only define a method inside a class but outside any other method definitons. (OK, …

Member Avatar for JamesCherrill
0
159
Member Avatar for Peter_Aye

ImageIO.read may return null rather than throwing an exception if, for example, it can't find a suitable decoder (not one of Sun's greatest decisions!) - so test for image == null after the read. You may also want to check what getWidth() and getHeight() are giving you there. You didn't …

Member Avatar for mKorbel
0
267
Member Avatar for sankubha
Member Avatar for sankubha
0
240
Member Avatar for RinzLove

I doubt that anyone will study 139 lines of code to find your syntax error. Why not make it a bit easier by posting the exact complete error message?

Member Avatar for JamesCherrill
0
336
Member Avatar for Petranilla

That's just the first part of a program, full of redundant (experimental?) code, and with some obvious mistakes (overriding paint, loading a new ImageIcon every time the user presses a key, repeatedly starting the same Timer... but most important, it doesn't show any code for adding or moving the enemy, …

Member Avatar for Petranilla
0
720
Member Avatar for akhilchandranms

In practice it's limited by the available memory, but if each instance does not have big data members you can create tens of millions of instances

Member Avatar for JamesCherrill
0
229
Member Avatar for jakubee

You could put the data in an array of arrays.. int[][] data = {{12345, 13455}, {12745, 13755}, etc then use that to construct Sectors to add to the arraylist 17: sectors.add(new Sector(data[i][0]. data[i][1])); or have a Sector constructor that takes a two-element array, so it's just 17: sectors.add(new Sector(data[i]);

Member Avatar for tux4life
0
369
Member Avatar for navi84
Member Avatar for sankubha

In your `getTableCellRendererComponent` method just test the `row` parameter to see if this is the first row, then return a JPanel or a JLabel as appropriate

Member Avatar for mKorbel
0
985
Member Avatar for purity_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
151
Member Avatar for sammygreat1234

It's highly unlikely that you have found a bug in Java's execution of if tests, so try a little debugging to confirm what's happening. Print B and PA immediately before the if test, put one print statement in the if, one in the else to confirm what is or isn't …

Member Avatar for JamesCherrill
0
113
Member Avatar for joseph.lyons.754

`16: String A1 = rowSet.getString("County_ID");` Maybe this should be `String A1 = rowSet.getString("Town");` ?

Member Avatar for joseph.lyons.754
0
291
Member Avatar for kevinyu

Your catch block is passed an Exception to tell you exactly what went wrong. You should always start by printing all that info: catch (Exception e) { e.printStackTrace(); ...

Member Avatar for kevinyu
0
235
Member Avatar for ExtraKanin

There's no reason at all to use JFrames like that. (In fact it's not even legal to add a JFrame inside another JFrame.) Just use JPanels, add your components to them, and pack() them. The layout manager will sort out the sizes. If you do have a suicidal comittment to …

Member Avatar for JamesCherrill
0
135
Member Avatar for murali2489

OK, we're ready to help... but you need to explain your thoughts so far, then we can make suggestions from there.

Member Avatar for stultuske
0
324
Member Avatar for joeymenje

You declared getRotatedModel as returning a object of class Model, but the method does not return anything

Member Avatar for JamesCherrill
0
145
Member Avatar for mikewyatt
Member Avatar for mikewyatt
0
164
Member Avatar for rotten69

It seems to me that the great majority of the people starting threads here are beginners/early stage learners anyway, so if there were a new forum as you suggest, what guidelines would you give people to tell them which forum to post in?

Member Avatar for renato.francia
4
870
Member Avatar for jakhondi

Replace all your System.out.printf statements with add statements for your text area, using String's format method to format just like in printf.

Member Avatar for JamesCherrill
0
189
Member Avatar for ccsj2206

Your use of ArrayLists corresponds to how Java was years ago, before version 1.5, and that's why your calculations (line 50) are difficult. With modern Java you can declare what kind of Objects the ArrayList can hold, eg `ArrayList<Double> priceList = new ArrayList<Double>();` now Java knows the contents will always …

Member Avatar for JamesCherrill
0
740
Member Avatar for sammygreat1234

The first thing to do is to fix your indentation to match exactly the { and } in your code. That will help you see where blocks end and which if's the else's match up with. If you are using an IDE or programmer's editor, use that for the indentation …

Member Avatar for JamesCherrill
0
179
Member Avatar for teppuus

`((javax.persistence.Query)null).getResultList();` What did you intend with this particular piece of syntax?

Member Avatar for JamesCherrill
0
1K
Member Avatar for dendenny01

Here is some (random) feedback on your program: There's not much wrong with that code really. This application is very small, and doesn't have much need for multiple classes or objects. You comment lines 11-27 with comments that add zero information to the code that follows, but then you have …

Member Avatar for JamesCherrill
0
327
Member Avatar for sankubha

You could open two connections, one for the file transfer and the other for the chat. Each would run in its own thread.

Member Avatar for kapildeven89
0
180

The End.