35,618 Topics
![]() | |
[B]Card.java[/B] [CODE] package poker; public class Card { int suit; int rank; public Card () { suit = 0; rank = 0; } public Card (int s, int r) { suit = s; rank = r; } public int getSuit () { return suit; } public int getRank () { … | |
Hi , how do i write a program on touch screen zoom , sroll left to right and right to left , how to open keyboard(virtual) when we focus on textfield or textarea. | |
@SuppressWarnings("unchecked") class MyBooks implements Comparable{ static final CompareLastName c1 = new CompareLastName(); static final CompareFirstName c2 = new CompareFirstName(); static final CompareTitle c3 = new CompareTitle(); static final ComparePrice c4 = new ComparePrice(); static final CompareISBN c5 = new CompareISBN(); static final CompareDate c6 = new CompareDate(); private String lastname, … | |
hello i am trying to write in file and when ever i do this previous lines overwrites in file .i am trying this code File f=new File("c:\\paul.txt"); //f.createNewFile(); BufferedWriter br = new BufferedWriter(new FileWriter(f)); BufferedReader br1=new BufferedReader (new InputStreamReader(System.in)); FileReader fr=new FileReader(f); // FileWriter frt=new FileWriter(f); // BufferedReader brz=new BufferedReader(fr); … | |
Posted below is currently my main class that works for a java blackjack game, i do have 3 other classes for the full game to work but this class is where my problem is. my problem is in the west border i have so much being written to the GUI … | |
I have deployed a simple web service using Apache Tomcat 6.0 and Axis 1.4 in Windows XP. Now the server is very simple: [CODE] import java.io.*; import java.util.*; /* HelloWorld.java This is our web service */ public class HelloWorld { public String getHelloWorld(String id) { String retName=""; try { File … | |
I'm a little new to programming and for my class I've been asked to do a recursive program where you input a directory and it will find all the files in that directory and any subdirectories in that directory, etc etc until there aren't any more subdirectories. Quite honestly, I'm … | |
I've been trying to figure out the code for this problem for a long time and I'm stumped. The problem is: The library for which we design this system has only books and magazines that are available for library members to borrow from its circulation. Users of the library are … | |
Hello, I am trying to do a first fit allocation in java my problem is how do i keep track of which memory block i have cheked and if there are no suitable blocks put the job in a waiting queue. Thanks for all help [CODE] import java.util.*; import java.util.Scanner; … | |
Hi All, I am just wondering how i would check if the below checkbox was clicked or not? [CODE] private JCheckBox postage = new JCheckBox("Postal Delivery?");[/CODE] When the form is submitted i need to check the box and get a boolean saying true or false based on clicked or not … | |
I need to get my jlist to simply display a one word subject. When I do it the way below, it obviously prints: "subject: blah location: blah date: blah path: blah." How can I get to set an JList to simply display the string title of the picture rather than … | |
I need to know a way to read a XML file from java. for example if the XML file is >> [code] <PHONEBOOK> <PERSON> <NAME>Joe Wang</NAME> <EMAIL>joe@ffff.com</EMAIL> <TELEPHONE>202-999-9999</TELEPHONE> </PERSON> </PHONEBOOK> [/code] I need to get the persons name, as in when i specify "NAME" the name 'joe wang' should display. … | |
Hi all, I know many here have been working on big project and can help me on this. We will be having a project to do and we are more than 3 people. We will be working at different times and places(We are not employed developers per se Just hobbyists). … | |
Hi, I am trying to make thumbnail viewer and having problem putting the thumbnail in the proper place. All I am trying to do is this: [CODE] iconPanel.add(iconBar, BorderLayout.NORTH); for (int x = 0; x < 4; x++) { iconBar.add(emptyThumbnail,BorderLayout.CENTER); repaint(); validate(); } [/CODE] Ant then whenever I scroll, [CODE]for … | |
hii the following is my xml file.. [CODE][/CODE] <?xml version="1.0" encoding="UTF-8" ?> - <categories> - <medicines> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421114126\2.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421114126\3_001.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421114126\3.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421114126\4.html</url> </medicines> - <treatment> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421114723\anemia-treatment-with-home-remedies.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421114723\ayurveda-encyclopedia-w.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421141322\alternative-treatments.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421141322\aromatherapy.html</url> <url>C:\Users\pcnet\Desktop\ayurveda_pages\20100421141322\free-home-remedy.html</url> </treatment> </categories> i want someone to help me to tell how to add a new url to the already existing xml file...new … | |
I'm writing a program that reads information from three seperate classes. Here is my code: [CODE] public class Animal { protected int id; protected String type; protected double mass; //------------------------------------------------------------------------ // Sets up an animal with the specified ID number, type and weight. //------------------------------------------------------------------------ public Animal (int animalID, String animalType, … | |
Hi, I made a java application to distribute on Mac osx. I created folder .app structure according to mac application. The application is being successfully launched by double click on Myapplication.app on Mac Osx which contains Java5. Its not launching the application on Mac with Java6. I searched for the … | |
I have this program where I need to get the suggested next move (a column index) and also call the 'go' method using this column as the parameter. This is what I have come up with so far. [B]Connect4Model[/B] [CODE]public class Connect4Model { Connect4Column [] columns; // an array of … | |
Hi I'm currently doing a connect 4 program and I need to write an apporpiate get and set methods so that the other classes can access this information. ('State of the autoplay' is simply whether red or yellow (or no-one) is set to have the computer make their move). I've … | |
Hi guys revising for an exam and im fine with the theory stuff but heres one question: A large ornamental garden is open to the members of the public who can enter through two gates: east gate or the west gate. The management wants to determine how many people there … | |
![]() | So in class we are making a program and we have a big problem with what is pretty much the last method we need. We want a download function, which basically takes a file already specified and copies it to the destination (and name) chosen by the user. WE have … |
hi i had created a Jtable Which Stores Data like below -------------------------------------------------------- a b c d e w q 1 2 9 -------------------------------------------------------- i want to get the cell value when i click to the cell... i tried lot but not got hte out put please help to get the … | |
I am not really familiar with the whole [B]SEO[/B] process but I recently hired someone at <snip> to do the whole process for me. The person there made me know that it is not smart to include a lot of my content in my [B]Javascript[/B] files as they are not … | |
hello, i am using preparestatement to insert muliple rows into database. [CODE]String query = "insert into table_temp(col1,col2) values(?,?)"; pstmt = con.prepareStatement(query); pstmt.setString(1,"a"); pstmt.setInt(2,100); pstmt.addBatch(); pstmt.setString(1,"b"); pstmt.setInt(2,null); pstmt.addBatch(); int[] cnt = pstmt.executeBatch(); [/CODE] My problem is that in the 2nd addBatch block i dont want to insert any value into the … | |
I'm writing a code segment that calculates and displays the number of holes upon which a golfer made an eagle. Which is two fewer than the par value for the hole. This is what I have come up with. [CODE] int[] par = new int[18]; int[] strokes = new int[18]; … | |
Hi, I am a newbie here, but I want to ask several things: 1. What is the advantage and disadvantage of using JSF than any other frameworks, such as Spring, Struts, GWT, etc? 2. Which java framework would best fit for building an airline reservation system? | |
Hello, I'm trying to read from the command line. There are 9 numbers and I want to store them in an array as int. I've alread the following [CODE] public static void main(String[] args) throws IOException{ String [] temp; public static void main(String[] args) throws IOException { InputStreamReader inputStream = … | |
hi everyone. well I have a small problem. Actually, I have an interface (ComplexNum) and a class (ComplexNumb).The end result is to do small calculation with some complex numbers. I have already implemented the interface in the class , but eclipse keeps on telling me that I have to implement … | |
Hi, When I tried to install Netbeans 6.1 in Vista, I get this error message: java.lang.RuntimeException: java.io.IOException: Could not get shell folder ID list Any help would be appreciated. Regards, Anthony | |
I have a gui with an ADD, EDIT, and DELETE button. All of which are not active until you click their respective name from the menu bar. Once I click on the DELETE key in the menu, it actives my delete button fine, but when I select an object from … |
The End.