1,963 Posted Topics

Member Avatar for Lordson60

So search for examples on how to read and write to a file. There are plenty in this forum. Also where are you having problems with?

Member Avatar for javaAddict
0
63
Member Avatar for Phoenix_7

Actually, If I may add, it does not print the memory address. That is the hashcode of the object. When you call the [ICODE]System.out.println(anObject)[/ICODE] what it actually does is call the toString method: [ICODE]System.out.println(anObject.toString())[/ICODE] Since you haven't overridden the toString method it uses the one from the super class the …

Member Avatar for Phoenix_7
0
122
Member Avatar for adity

What do you mean each cell element. What do you want to do with the Jtable at the GUI ?

Member Avatar for javaAddict
0
88
Member Avatar for spartanace

You can pass to the KeyPad constructor the element you want to change. [CODE] JLabel label = new JLabel("THIS IS THE LABEL"); Keypad key1 = new Keypad(label); [/CODE] [CODE] public class Keypad extends JPanel{ private JButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12; [B][COLOR="green"]private JLabel label; public Keypad(JLabel lbl) { this.label = lbl; }[/COLOR][/B] { public …

Member Avatar for javaAddict
0
3K
Member Avatar for Memo..~

[QUOTE=Ms. Kavita;1231551][B][COLOR="Red"]U have to do it by your self my dear and submit to me in ur class on Saterday Regard Ms.Kavita[/COLOR][/B][/QUOTE] If this post is for real then 2 thumbs up. LOL!

Member Avatar for s_sridhar
0
111
Member Avatar for DeadSoul

The only thing I see commented is the JColorChooser not the JFileChooser. Can you make that clear? I am talking about the first few lines of the openFile method. All the JFileChooser are there. Do they work?

Member Avatar for leiger
0
164
Member Avatar for hodna1

This is a java forum. For the first, you can have an int array of length the number of letters in the alphabet (24 or 26) Loop each String of the list and take each character and increase the right element of the array by one. the first element for …

Member Avatar for jwenting
-1
99
Member Avatar for haseena04

Why did you make 2 posts with one hour difference? Now people will start answering both and it would be a total waste of their time?

Member Avatar for javaAddict
-1
160
Member Avatar for haseena04

That error tells you exactly what is the problem and where to look: Exception in thread "main" java.lang.NullPointerException .... at Clustering.main(Clustering.java:39) At the Clustering.java file line 39, in the method method, you are using something which is null

Member Avatar for javaAddict
0
85
Member Avatar for bigmouthmonster

Have an array of Color instances with the potential colors and a global index. With click of the button use the element at the current index and increase the index by one. So with the next click the next color will be used. When the index reaches the length of …

Member Avatar for javaAddict
0
95
Member Avatar for pavank_karanam

[QUOTE=pavank_karanam;1236083]Hi, In student project have use 2 combo boxes (state and district) how to write the in jsp code please anybody tell me my mail[/QUOTE] Start a new thread, post some code and read for starters some tutorials. For html this helped me a lot: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL]

Member Avatar for javaAddict
0
78
Member Avatar for mozten

When the Net Beans compile the project they create a jar file and a README.txt file. Take the jar file and follow the instructions in that file. Try to run the jar file from a command prompt. Also wouldn't you present the source code as well? And it most essential …

Member Avatar for javaAddict
0
101
Member Avatar for Fisher78

[CODE]while (summan >= k){[/CODE] You set summan to be zero and I assume that k is something positive. Then how is it possible for 0(summan) to be greater then k ? Also this is redundant: [ICODE]summan = summan ++;[/ICODE] Try this: [ICODE]summan += 1;[/ICODE] Or this: [ICODE]summan++;[/ICODE]

Member Avatar for javaAddict
0
122
Member Avatar for zango

[QUOTE=zango;1234654]So after going over this a few times I found that the issue was with the 5/9 and 9/5. For some reason Java was not calculating them correctly so I had to input the decimal equivalents instead.[/QUOTE] You were right ti out the decimal equivalents, but java was calculating them …

Member Avatar for javaAddict
0
755
Member Avatar for DanJack90210

What you are trying to do is very simple and explained in all basic GUI tutorials. Try to search some at the site of SUN

Member Avatar for DanJack90210
0
218
Member Avatar for MDCS

[QUOTE=MDCS;1232008]How is the code for ajax look like?[/QUOTE] Check the tutorials of AJAX at the w3schools site: [URL="http://www.w3schools.com/default.asp"]http://www.w3schools.com/default.asp[/URL] Or use jquery: [URL="http://docs.jquery.com/Main_Page"]http://docs.jquery.com/Main_Page[/URL] and [URL="http://malsup.com/jquery/form/"]http://malsup.com/jquery/form/[/URL]

Member Avatar for javaAddict
0
46
Member Avatar for ekseks

Look at the API of java.util.Vector, check some tutorials about sending data through request and come back with some code

Member Avatar for jwenting
-1
92
Member Avatar for kizito106

Telling you the solution will not solve anything. Net Beans tell you where the error is and what is the problem. If you can't fix it then I would suggest to stop what you are doing and start by reading very, very basic tutorials and try to learn simple basic …

Member Avatar for jwenting
0
139
Member Avatar for MichaelMelamud

Well, you cannot mix java with JSP. Meaning that you cannot just execute a java function when a button is clicked, because java is executed at the server and when you are at the page, you are at the client. What you can do is, when you click a button …

Member Avatar for javaAddict
0
8K
Member Avatar for karanits

[CODE]<% String init= "3"; %> <select name="dropDown"> <option value="1" <%= ( "1".equals(init) )?"selected":"" %> >One</option> <option value="2" <%= ( "2".equals(init) )?"selected":"" %> >Two</option> <option value="3" <%= ( "3".equals(init) )?"selected":"" %> >Three</option> <option value="4" <%= ( "4".equals(init) )?"selected":"" %> >Four</option> <option value="5" <%= ( "5".equals(init) )?"selected":"" %> >Five</option> </select> [/CODE] Although …

Member Avatar for karanits
0
135
Member Avatar for Virux

Class B has the username variable because it inherits A. But If you want to access it then you need to choose how to access it: private, public protected. I think that since you didn't add anything it is private so naturally you cannot access from outside that class. You …

Member Avatar for javaAddict
0
113
Member Avatar for Adhoc82

In one code you do this: [CODE]System.out.println(moviesList.get(1).printMovies());[/CODE] Which is correct. And at the other, you do this: [CODE] inputLine = n_moviesList.get[i].printMovies(); [/CODE] which is wrong.

Member Avatar for Adhoc82
0
9K
Member Avatar for klactose
Member Avatar for amrideep

How exactly did you write this: [CODE] out.print=(String)session.getAttribute("ana") //it prints null [/CODE] In your code?

Member Avatar for Dharmendra
0
87
Member Avatar for ceyesuma

You do this to compare the users: [CODE] while(rs.next()){ String user=rs.getString(1).trim(); } if (!newUser.equals(user)) { } [/CODE] You put the username in the "user" variables that is defined and initialized in the while loop, but the one you are using for comparing the names is a different user variable. The …

Member Avatar for ~s.o.s~
0
159
Member Avatar for Stefano Mtangoo

You hardly use session. Maybe you should put it in request and use request dispathcer to send the request to another jsp or servlet. Use the request.setAttribute(String, Object) and the request.getAttribute(String)

Member Avatar for Stefano Mtangoo
0
79
Member Avatar for JMChurch25

Read this: [QUOTE=Ezzaral;831934]Do not hijack old threads merely to post "give me teh codez". If you have a question about an assignment, start a new thread and post the code that you have as a start.[/QUOTE]

Member Avatar for vanessa1106
0
973
Member Avatar for kakashi_sensi

The alert will not fire because it is in the else block. The if is true: [CODE] <% // the if is always true. It will not go to the else and the alert which is inside the else will not execute if (true) { } else { %> <script>alert("error");</script> …

Member Avatar for kakashi_sensi
0
226
Member Avatar for kesh1000

[QUOTE] Make transactions: Many products are sold to customers by salesman in one visit. Transactions for each product with its quantity is recorded in transaction_product.dat file and the receipt no is recorded in transaction.dat file. It is important to note who sold the products. Salespersons bring the manual receipt to …

Member Avatar for javaAddict
0
132
Member Avatar for bmbvm5
Re: Help

First create a class Ferry with the necessary attributes and method for adding passengers. Use the assignment's specifications in order to find out what methods you should have and they should do.

Member Avatar for bitthu
0
194
Member Avatar for yeezy_10

Check the API of the String class. There is a method that converts the String into an array of chars. Now loop that array and see if the first element is equal with the last. The 2nd with the last -1 The 3rd with the last -2 The 4th with …

Member Avatar for masijade
0
206
Member Avatar for drweere

2 for loops. Use the System.out.print() method to print at the same line and System.out.println() to change lines. The index will tell you which number to print and how many times(inner loop)

Member Avatar for javaAddict
0
48
Member Avatar for pinsickle

When the button is clicked you can hide, or better dispose(I think that that is the name of the method of the JFrame class) and create new window. [CODE] class JLogin extends JFrame ... { .. public void methodUsedWhenLoginButtonClicked(ActionEvent evt) { JMainPage mainPage = new JMainPage(); mainPage.setVisible(true); this.dispose(); // use …

Member Avatar for javaAddict
0
115
Member Avatar for nagesh1811

I couldn't understand much from your question, but I think that meant this: [CODE] employee emp[]=new employee[5]; ..... if (order by id) { Arrays.sort(emp,new idComparator()); } else if (order by name) { Arrays.sort(emp,new nameComparator()); } for(int i=0;i<emp.length;i++){ System.out.println("empID : "+emp[i].getID()+" empName :"+emp[i].getName()); } [/CODE]

Member Avatar for javaAddict
0
195
Member Avatar for spotlight87

This is the html code you are displaying at the page: [CODE] <a href=\"welcome.jsp\"> </a> [/CODE] But there is nothing between the <a> </a> , so the link is there and you can click it. The problem is that you don't display anything to show the user where the link …

Member Avatar for spotlight87
0
308
Member Avatar for KONTOL

You wrote this: [CODE] private String[] typeStrings = {"Antonov", "Cessna"}; private JComboBox typeList = new JComboBox(typeStrings); [/CODE] How is it possible to change this "Antonov" or this "Cessna" into an int ?

Member Avatar for moutanna
0
184
Member Avatar for Chaster

You can use the split method to create an array of the words of the String. Take that array and sort it. Then create a new String from that array. So now you have a new String with the words of the previous one sorted. Now you can use the …

Member Avatar for javaAddict
0
80
Member Avatar for bigsurya

No, c is an array of objects. c[i] is the object which is null because you haven't initialized it. c[i] is null, c[i] is a College object, c is an array

Member Avatar for bigsurya
0
133
Member Avatar for indu_ss4

When the use logs in, put its username in the session: [CODE] session.setAttribute("USER", username); [/CODE] At the beginning of each page you can do this: String username = (String)session.getAttribute("USER"); if(username==null) { // session expired // FORWARD WITH ANY WAY YOU WANT // I don't know about this one. I usually …

Member Avatar for indu_ss4
0
3K
Member Avatar for charlieruns

You mean display only one element of the array? You can create an array that has only one element, the element you want to display. But that would make the JList useless since that is not its purpose. Maybe you can change the way you add the JList to the …

Member Avatar for charlieruns
0
85
Member Avatar for AcidG3rm5

The String class has the charAt method. "Loop" the String using its length and get each character of the String. Then if you take that character and put it into an int, you have the ASCII: [CODE] for-loop { char ch = yourString.charAt(i); int ascii = ch; System.out.println(ascii); } [/CODE]

Member Avatar for AcidG3rm5
0
106
Member Avatar for redleafrose

[CODE] Staff staff1 = new Staff(); // and call its methods to set the name and the other values. Then call its other methods to display it. [/CODE] Doesn't this code works? [CODE] try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please input a name and press Enter "); String …

Member Avatar for wildplace
0
95
Member Avatar for ceyesuma

At that line something is null: [U]at model.dao.ConnectDerbyDAO.createTables(ConnectDerbyDAO.java:158)[/U] My guess is the connection. So try to go to that line and print the objects you are using. Also you need to close the connection, statement in the finally block.

Member Avatar for ceyesuma
0
338
Member Avatar for Lulie

Then create instances of the BinaryNode class and construct the tree by giving values to the .left and .right nodes. Then call that method with argument the root node. For reading input use the Scanner class

Member Avatar for Lulie
0
120
Member Avatar for schender

The first argument is with '?' [CODE] <a href="JSP2.jsp?id=1&name=2&aaaa=b">Link</a> [/CODE] And the others with '&'

Member Avatar for javaAddict
0
227
Member Avatar for lilpinay
Member Avatar for the_preface

Also what will happen if the animalID is 3000? Look at your code. Maybe you need to add some >= to one of the expressions you have in the ifs

Member Avatar for javaAddict
0
171
Member Avatar for zigana91

Have you imported DecimalFormat? [ICODE]import java.text.DecimalFormat;[/ICODE]

Member Avatar for javaAddict
0
156
Member Avatar for pradeepktg
Member Avatar for zreed

[QUOTE=zreed;1213718] If someone could code this program by 5/9/10 it would be great. Thanks!![/QUOTE] When was this assignment given to you?

Member Avatar for Katana24
0
264

The End.