32,199 Topics
| |
how to modify the contents of a file Example:: If there is a file with hello #how are you Then how to delete the # and maintain the same file | |
I've recently posted a thread called file modification and the problem has been solved........now could some1 kindly explain why is it necessary to delete and rename the file to insert or delete a character into the file at a particular location Thanks | |
How would you go about skipping non-numeric characters in a string and only adding the sum of the numbers a multi line string? | |
Hey guys I am still learning how to use simple java. I want to try to do this program which i found in some book, but i cant seem to get how to started. They say its a beginners program, but i found it quite difficult on how to start. … | |
OK, here's what I want to do (I realize the code below doesn't work, but it's what I would LIKE to do). I've converting things from C++ [code=JAVA] public void ChangePrimitiveArray(byte bytes[]) { bytes[0] = 1; } public void foo() { byte bytes[] = new byte[2]; bytes[0] = 4; ChangePrimitiveArray(bytes); … | |
Hi im working on this program im getting a runtime error that says this ArrayIndexoutofbounds exception 0. heres my code [code] import java.util.Scanner; public class MillerCalculateTime { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter miles: "); double miles = sc.nextDouble(); System.out.print("Enter Miles per hour: "); … | |
i have to construct a rectangle, print the location, then translate/print it 3 more times such that if they were drawn, they would form one large rectangle. [][] <- like so [][] here's the code & the error. C:\java>javac FourRectanglePrinter.java FourRectanglePrinter.java:11: [COLOR="Green"]incompatible types[/COLOR] found : void required: java.awt.Rectangle Rectangle box1 … | |
Hi! I would like to read XML file from my SWING application, however [ICODE]list.size()[/ICODE] returns 0. Why does it happen? Thanks! [CODE] private void open() { SAXBuilder builder = new SAXBuilder(); File xmlFile = new File(openedFileName()); try{ Document document = (Document) builder.build(xmlFile); Element rootNode = document.getRootElement(); List list = rootNode.getChildren("Panel"); … | |
Hi! I would like to select images by using a rectangular area. All images that are inside this area, must be selected. I want this area to appear while mouse clicking and dragging. So, the size of a rectangular area should change dynamically according to a position of the mouse … | |
[code=java]import java.text.DecimalFormat; import java.util.Scanner; public class Main { public static void main (String[] args) { String inputString; //For reading input. String input; //Read Input double automobileCost; double warrantyCost; double downPaymentAmount; double interestRate; double numberPayments; double salesTaxAmount; double totalPurchaseCost; double amountFinanced; double loanInterestRate; double loanLength; double monthlyPayment; double annualInterestRate; // Create … | |
This is more than likely the dumbest sounding problem most of you will have ever heard of, but after three days of attempting to fix this myself, I have gotten no where. I am working on an older project, it works fine, but I need to upgrade it an add … | |
Hi all, ive got a problem relating to the log4j.jar file (I suppose it would be the same problem regardless of what the .jar file is). I created a library based off the log4j.jar file, and the logging works and everything runs smoothly on my laptop. However, when I use … | |
Hello, I am having a hard time with a easy problem. I need to ask a user how many scores they would like to enter (up to 15) and then use a method to get the number of scores. in the form of Enter score 1: xx.xx Enter score 2: … | |
I have hundreds of text files with data sorted in 3 columns and an unspecified number of rows. The number of columns can increase in the future, but will always be equal for all files. I want to combine these data into a single file with all the columns put … | |
Hey guys! This is the code for a program I started today: [code=java] /* * IdeaCaptureMain.java * * Created on Jan 25, 2011, 4:33:45 PM */ package Idea; /** * * @author WolfShield */ public class IdeaCaptureMain extends javax.swing.JFrame { /** Creates new form IdeaCaptureMain */ public IdeaCaptureMain() { initComponents(); … | |
| |
I have been doing an assignment for my my first year software course, in which we have to make a simple TicTacToe program in java. For the final 30% mark, we have to add a GUI in. Apart fro a tutorial only teaching me the basics (how to make boxes … | |
[CODE]public void buildTree(List<Fool> treeArr,Fool tr) { if(tr.getChild().size() == 0) { for (Fool cur : treeArr ) { if (cur.getParentId().intValue() == tr.getRight().getRightId()) { tr.getChild().add(cur); cur.setParent(tr); buildTree(treeArr, cur); } } } }[/CODE] there is around 10000 data, and the code is very slow. Its taking 8.5 second, I need to speed it … | |
I was wondering if someone could check this for me. Ive to write a loop in words, this is what ive came up with. while (there are days left in holiday) if (sunny) go to beach else go to swimming pool go home Basically its a program that tells you … | |
Hi Can some one give me some idea about code for icp protocol for client server Architecture in java. Thanks | |
Hello Members, Can anyone point me to a web link which has the java code for a simple game that uses the keyword synchronized and the thread synchronization functions, wait() and notify()? Thank you! | |
Hey Everyone, How would you go about writing a program that draws an image of an ice cream cone, using JFrame and JComponent classes, with a triangle on bottom and a circle on top? | |
Hi, am trying to use a multicast socket in an application but I constantly get this exception; java.net.SocketException: error setting options. I have failed to find its cause and how to solve it. Pliz help (what could be causing it, and how can i solve it? thanx. | |
why when i write this down : [CODE] private Statement getOrders_st=null; public ResultSet getOrders(String UserName) { ResultSet Rs=null; try { getOrders_st = Conn.createStatement(); Rs = getOrders_st.executeQuery("select order_history , ordr_date , ordr_total from orders where ordr_userid = '"+UserName.toLowerCase()+"'"); } catch(SQLException ex) { ex.printStackTrace(); } return Rs; }[/CODE] give NullPointerException at [CODE]getOrders_st … | |
There is a working code about a program in which you should create differen Cat objects with name and color parameter and apply method to the objects. The problem is that I get the method working for only the last cat [CODE]public class Cats { public static String name; public … | |
how we create a button using swing class..... I need help b/c I want to make a calculator but I am beginner and i dnt know swing class... Plz help me to create a button.....!!!!!!!1 | |
Hello, can you guys please sugest a way to have today date substracted 7 days, and have al of this 7 days into one String array? thanks. | |
I really need help, my 1st assigment is due tomorrow and i've been working on it for a really long time and is just not getting it!!!! So please help me, it will be greatly appreciated. These are the questions that I haven't been able to figure out. Add a … | |
Greetings, I am about 4 hours into JAVA and am making a big mess of it. Last night (at home) I installed the latest JAVA and NetBeans and got a "Hello World" Today I installed the 2 at work and am getting errors involving: "NoClassDefFoundError" (even with what worked last … | |
I have a calculator program I am working on, it works except for one thing. When I type a large number into the calculator, say 125^4 it comes out with: 2.44140625E8. Any ideas on how to get this in-build function turned off? Thanks! -[b][i]WolfShield[/i][/b] |
The End.