7,116 Posted Topics

Member Avatar for sathya88

You can download the source code for the classes in the Java SE API from the Oracle web site.

Member Avatar for sathya88
0
216
Member Avatar for madhub2v

So would I. The API doc doesn't use the term "marker" for it, so who says its a marker interface?

Member Avatar for JamesCherrill
0
68
Member Avatar for ganeshtr24

So it can be accessed from outside its own package. See [url]http://download.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html[/url]

Member Avatar for Muralidharan.E
0
68
Member Avatar for shan123456

Like it says at the top of the page... [QUOTE]Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.[/QUOTE]

Member Avatar for sirlink99
0
184
Member Avatar for andersonelnino

Java names are case-sensitive. Method names in the API begin with a lower case letter. Check your method names for capital vs lower case against the API reference.

Member Avatar for peter_budo
0
184
Member Avatar for rotten69

You have 689 uncorrected compile-time errors. Yet you say [QUOTE]It is strange that eclipse doesn't find any code to execute. How do you think I can possibly fix the issue?[/QUOTE] There won't be any code to execute until the compiler generates some. The compiler won't compile your code until you …

Member Avatar for rotten69
0
10K
Member Avatar for hatebin

You need to 1. Create a new XMLDecoder, passing an input stream as parameter then (and this is the bit you are missing) 2. Use the XMLDecoder's readObject() method to get the object itself.

Member Avatar for hatebin
0
116
Member Avatar for Jessurider

Short version: set your own default renderer for that cell or column using a subclass of JButton. Full version: [url]http://download.oracle.com/javase/tutorial/uiswing/components/table.html#renderer[/url]

Member Avatar for JamesCherrill
0
135
Member Avatar for sreeram01

The problem appears to be in (String)yahooConnection.getContent() Check the API doc for this method - it returns an Object, in this case its an HttpInputStream object) and that kind of object cannot be simply cast to a String. (In fact it's not even a public class). You should probably be …

Member Avatar for JamesCherrill
0
974
Member Avatar for harinath_2007

[QUOTE=StuartMillner;1611917]thank goodness they overhauled collections... project lambda is pretty sweet too[/QUOTE] What are the changes to collections? I couldn't see anything in the release notes. AFAIK project lambda didn't make it into J7, but is still planned for J8.

Member Avatar for jwenting
0
138
Member Avatar for laguardian

Sure, you can do that in Java, but unless there's something special you need to do why not look at a simpler solution such as an SQL database with form & report generation, or even Excel with a few macros?

Member Avatar for jwenting
0
173
Member Avatar for JavaStudent101z

I don't understand your question. Look at the cases for 'A' and 'a' - they call a method optel() when the user chooses 'A' or 'a'. Isn't that "a normal choice"?

Member Avatar for NormR1
0
135
Member Avatar for aman rathi

abc a[]=new abc[4]; creates an array of reference variables that can refer to abc objects, but it doesn't populate those references with anything, so the initial values in that array are like {null, null, null, null}. You need to create four new abc instances for the four array elements, eg …

Member Avatar for JamesCherrill
0
103
Member Avatar for Majestics

[QUOTE=Majestics;1613064]My main aim is to provide a startup animation , so application before start produce a good effect on the user, like word, excel etc...[/QUOTE] You should have said that earlier. It's easy. Java 6 has a "splash screen" capability that displays an image while your app is loading, and …

Member Avatar for Majestics
0
100
Member Avatar for new_developer

Those 3 terms are all very similar, and people will use them almost interchangeably. But here's my attempt to distinguish the main uses of them, while ignoring some of the more obscure exceptions: [B]Data [/B]is everything that's not executable code. It's the ints, booleans, bytes, Strings, arrays etc that a …

Member Avatar for JamesCherrill
0
214
Member Avatar for laguardian

You need to request that the new window comes to the front and gets the focus, eg page.toFront(); see this for more info: [url]http://download.oracle.com/javase/tutorial/uiswing/misc/focus.html[/url]

Member Avatar for laguardian
0
139
Member Avatar for farhanrocks

Yes we can, but why should we? What have you done so far? Google search both those terms, read the excellent documentation that you will find, then come back here with any specific questions.

Member Avatar for JamesCherrill
0
79
Member Avatar for phoenx

Did you not read Norm's post re equals method? Or did you just decide to ignore it?

Member Avatar for phoenx
0
165
Member Avatar for Farhad.idrees

Well, yes, Year is an array of 6 Strings, values is an array of 5 ints. What exactly do you want to do? It looks like you are trying to overwrite the initial String values with ramdom ints - does this make sense? Anyway, you can't put ints into an …

Member Avatar for Farhad.idrees
0
149
Member Avatar for 47pirates
Member Avatar for mKorbel
1
181
Member Avatar for vomhaus

[QUOTE=NormR1;1612429]Using The index is the ONLY way to get elements out of an array.[/QUOTE] Or an enhanced for-each loop (may be easier)?

Member Avatar for NormR1
0
227
Member Avatar for cweeto

[url]http://download.oracle.com/javase/tutorial/networking/sockets/clientServer.html[/url]

Member Avatar for JamesCherrill
0
43
Member Avatar for reemhatim
Member Avatar for akasekaihime
Member Avatar for akasekaihime
0
252
Member Avatar for laguardian

[CODE]OutputSched; OutputSched = new OutputSched();[/CODE] The first line is just a class name on its own, the second tries to assign a new instance to an existing class name. Neither of these lines is valid Java. If you just want to create a new OutputSched then a simple [ICODE]new OutputSched();[/ICODE] …

Member Avatar for JamesCherrill
0
161
Member Avatar for chixm8_49

Your Vector does not seem to have any type associated with it, so it's assumed to contain Objects, so enu.nextElement() is seen as returning an Object. System.out.println is a bit cunning in that it secretly calls the toString() method on anything you try to print, so your enu.nextElement() gets converted …

Member Avatar for NormR1
0
195
Member Avatar for sahil1991

Suppose [I]f1=new FileInputStream(p[0]);[/I] fails. You will go to the catch block, print a message and continue. Eventually you get to [I]i=f1.read();[/I] but f1 will not have been initialised. That's the circumstance the compiler complained about. Now if you have a [I]return;[/I] in the catch block you will not continue after …

Member Avatar for NormR1
0
138
Member Avatar for thesimplestnick

DefaultListModel implements Serializable, so you can read/write one with a single Object I/O call, or use XMLEncoder/Decoder to write & read the whole contents as XML string data, also in a single call.

Member Avatar for JamesCherrill
0
163
Member Avatar for sirlink99

If you're not using an applet (ie using a standard desktop app) then the applet restrictions don't apply. What you describe is straightforward. The hardest bit is how the clients get the server's IP address (unless you're happy to hard-code something). jwenting's security issues are still very real.

Member Avatar for Ezzaral
0
682
Member Avatar for smoothe19

Writing directly to an Excel file is possible but difficult. Why not write a simple text format file (eg comma or tab delimited) that Excel can import? That's really easy

Member Avatar for hfx642
0
133
Member Avatar for FALL3N

[I]while (strLine.length() >= 3)[/I] Once this loop has started, under what circumstances will it ever stop?

Member Avatar for JamesCherrill
0
160
Member Avatar for gyno

A static variable has exactly one value, which is associated with the class itself. To access the variable you just need the class name. A non-static ("instance") variable has one value for each instance of the class that has been created. To access any one of those values you need …

Member Avatar for JamesCherrill
0
98
Member Avatar for Majestics

Use the join() method from the Thread class - it waits until the thread has finished. Plenty of examples on the web.

Member Avatar for Majestics
0
115
Member Avatar for akasekaihime

[CODE]for (int x=0;x<3;textJT[x].setText(temp).x++);[/CODE]you probably meant[CODE]for (int x=0;x<3;x++) textJT[x].setText(temp);[/CODE]ps: many people would prefer[CODE]for (int x=0;x<3;x++) { textJT[x].setText(temp); }[/CODE]

Member Avatar for JamesCherrill
0
1K
Member Avatar for smoothe19

Redirect System.out Something like... [CODE]String fileName = "whatever.txt"; final boolean append = true, autoflush = true; PrintStream printStream = new PrintStream(new FileOutputStream(fileName, append), autoflush); System.setOut(printStream);[/CODE]

Member Avatar for JamesCherrill
0
3K
Member Avatar for marekbar1985

What's missing in your code is all the e.printStackTrace(); statements in your catch blocks. Right now you could be getting any of those exceptions and you won't know. As a general rule you should NEVER have an empty catch in a new program unless you are very sure why you …

Member Avatar for JamesCherrill
0
117
Member Avatar for newcoder310

Hi Majestics. Can you explain what this is about in terms that we all can understand? I'm completely baffled by the OP's version.

Member Avatar for JamesCherrill
0
88
Member Avatar for sirlink99

Two comments: 1. [I]if (someCondition== true[/I]) is a bit silly. What's wrong with [I]if (someCondition)[/I] 2. [I]for (int i = somePositiveIntegerValue; i < 0; i--){...[/I] // eg your line 86 How many times will this loop execute (when will i<0 be true)?

Member Avatar for sirlink99
0
368
Member Avatar for chixm8_49

You are trying to read from some kind of input stream, but the data is in the wrong format. This can happen if the format for reading doesn't match the format in which it was written, or the stream hasn't been closed properly, or you try to read the same …

Member Avatar for chixm8_49
0
214
Member Avatar for kujta1

If you want an application (not on a browser) then forget applets and servlets, as these are for browsers. Java GUI applications are normally built using the Swing classes that come with every Java installation. If the GUIs run on remote machines accessing a shared database server then you have …

Member Avatar for JamesCherrill
0
85
Member Avatar for FALL3N

[url]http://java.sun.com/developer/technicalArticles/ALT/Reflection/[/url] See the sample code under heading "Creating New Objects" about 2/3 down the page.

Member Avatar for NormR1
0
382
Member Avatar for conanzz

In your btOK ActionListener just create a String with the desired text in it and use the label's setText method to update it with that String. Use setHorizontalAlignment to centre a JLabel's contents inside the JLabel. To centre the JLabel in the window use a Layout Manager (see previous post). …

Member Avatar for mKorbel
0
299
Member Avatar for vomhaus

Previous code is a good example of why an ArrayList is a better choice than an array for returning an unknown number of Objects - there's no need to size it, just keep adding Objects until they are all added.

Member Avatar for murali_quest
0
105
Member Avatar for manjupargavi

from the JComboBox documentation... [QUOTE]setSelectedIndex(int anIndex) Selects the item at index anIndex. setSelectedItem(Object anObject) Sets the selected item in the combo box display area to the object in the argument.[/QUOTE]

Member Avatar for JamesCherrill
0
2K
Member Avatar for murali_quest

Although you can in theory put pretty much anything you like on the clipboard, it can be difficult. You can use XMLEncoder to convert your Swing objects to a simple text String that is really easy to put on the clipboard, and XMLDecoder to re-create the object from the clipboard …

Member Avatar for murali_quest
0
240
Member Avatar for hatebin

You really don't need to do this all one char at a time. The String class has all the methods you need working with whole strings at a time, eg [QUOTE]indexOf(String str) Returns the index within this string of the first occurrence of the specified substring.[/QUOTE] as in [CODE]index2 = …

Member Avatar for JamesCherrill
0
139
Member Avatar for zachf632

It's a myth that Java is slow. The JRE is highly optimised and performs comparably to [I]ordinary [/I]C++ code. Only in the most performance-critical CPU-intensive tasks will you see any real benefit from [I]properly tuned[/I] C++ Have a look at [url]http://scribblethink.org/Computer/javaCbenchmark.html[/url] that was 2004, but the JRE has only improved …

Member Avatar for pseudorandom21
1
208
Member Avatar for baby_c

That's right. Java is only pass by value, regardless of whether parameters are primitive types or reference types. [QUOTE]When the method or constructor is invoked (ยง15.12), the values of the actual argument expressions initialize newly created parameter variables, each of the declared Type, before execution of the body of the …

Member Avatar for JamesCherrill
0
253
Member Avatar for civirol02

Your initial value for smallest is 0 - think that through. What result do you expect with that starting value? If you still don't get it post again and I'll give you a more explicit hint. ps: Please post all code in code tags in future.

Member Avatar for civirol02
0
3K
Member Avatar for Dhanesh10

The exception message includes the exact line where it was thrown, ie Home1.<init>(Home1.java:32) what is the code at that line?

Member Avatar for Dhanesh10
0
6K

The End.