32,199 Topics
| |
hello Folks, I would really appreciate if I could get some help on this. I have an Integer lets say number = 12345 I want to get a string out which is 12,345 so basically puts a commas after every three digits... the number of digits in the number can … | |
I have a programming question that calls for me to write a program that concatenates the contents of several files into one file. For example, java CatFiles chapter1.txt chapter2.txt chapter3.txt book.txt makes a long file, book.txt, that contains the contents of the files chapter1.txt, chapter2.txt, and chapter3.txt. The output file … | |
I'm working on a program that calls for me to write a program that opens a binary file and prints all ASCII characters from that file, that is, all bytes with values between 32 and 126. Print a new line after every 64 characters. Here is a sample program run: … | |
Hi, I am vishnu kumar. I knew the basics of Java but this is the first time i am building a project based on java (Java Swing actually). This is my final semester project and for last two months, i am doing my project. I initially thought the database(along with … | |
Write a program that rolls a dice (but hide the number from player) and then ask user enter a number in range of 1 - 6. If player enters same number of computer rolled, then the player earns $10. If player enters a number that is smaller or larger by … | |
I have an assignment that calls for me to Write a program Find that searches all files specified on the command line and prints out all lines containing a keyword. For example, if you call java Find ring report.txt address.txt Homework.java then the program might print report.txt: has broken up … | |
| I need to find a word in JTextArea and highlight it, can you help me with this code? [CODE]class managerClass implements ActionListener { @Override public void actionPerformed(ActionEvent e) { String myWord = txt.getText(); Highlighter h = textArea.getHighlighter(); if (e.getSource() == bFind) { pattern = Pattern.compile("\\b"+myWord+"\\b"); Matcher matcher = pattern.matcher(myWord); while( … |
Hello, I have created a game in java and I would like to insert enemies. For now I placed them on plaftforms that I made invisible. How can I have the enemy on its own? | |
guys, I need help in swing framework... what method is being used when you have to pressed exit button first before opening other frames? It's like an equivalent of showDialog() from C#.net. | |
here i have code it work well here i have assigned size of the row and column. how can i get the row and column value from text file.[CODE]import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; public class csvimport5 { public static void main(String[] args) throws IOException { … | |
Hi Sorry i was doing a little program and i need helps i would like to something similar to that [url]http://i42.tinypic.com/2mys23d.png[/url] this is my code so far [code] private void makeFrame() { frame = new JFrame("Jubilee Estate Agency Property"); makeMenuBar(frame); Container contentPane = frame.getContentPane(); JLabel label = new JLabel(); contentPane.add(label); … | |
I receive error at camera.Camera.<init>(Camera.java:19) at camera.Camera.init(Camera.java:32) at camera.Camera.<init>(Camera.java:21) at camera.Camera.init(Camera.java:32) at camera.Camera.<init>(Camera.java:21) at camera.Camera.init(Camera.java:32) at camera.Camera.<init>(Camera.java:21) at camera.Camera.init(Camera.jav and continues. Please help, last day [CODE]package camera; import javax.swing.*; import java.awt.event.*; import java.awt.event.ActionListener; /** * * @author FDR */ public final class Camera extends JFrame{ private JTextArea txt; private Camera … | |
| Can you help me with this code, I need to find a word, but it only finds first word, how to find multiple words? [CODE]lass managerClass implements ActionListener { @Override public void actionPerformed(ActionEvent e) { String myWord = txt.getText(); Highlighter h = textArea.getHighlighter(); String searchArea = textArea.getText(); if (e.getSource() == … |
| Given a UML diagram of: Oval ------- ------- +draw (g:Graphics, x:int, y:int) +toString(): String I have currently [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Oval extends Shape { public Oval (Color color, boolean isFilled, int width) { super (color, isFilled, width); } public void draw (Graphics g, int x, … |
so heres my code [CODE] import java.awt.*; import java.text.*; import java.util.*; import java.util.List; // Explicit import required import javax.swing.*; public class Sort { public static void main(String args[]) { Runnable runner = new Runnable() { public void run() { String words[] = {"Sean", "Beth", "Ryan", "Bree", "Jim", "Bob"}; List list … | |
[I]This exercise will explore the queue and stack data structure implemented with linked lists. The Koch snowflake can be implemented without recursion by using a queue or a stack. Assume that L is either a queue or a stack, L.add( seg ) adds a segment, and L.remove() removes the segment. … | |
Hi everyone... i am currently doing a java system concerning file transfers between server and client... file transfer starts from the server.. So far, i have done one file transfer. However, i would like to program my code in such a way that the client actively still listens to the … | |
Hello! I have two Hashmaps: [CODE]POINTS (String/int) Player A: 0 Player B: 3 Player C: 5 Player D: 2 Player E: 5 Player F: 3[/CODE] [CODE]TIME (sec) (String/int) Player A: 0 Player B: 15 Player C: 9 Player D: 8 Player E: 12 Player F: 15[/CODE] The progrom should first … | |
good evening everyone, uhmm can someone here please help me how to get the internet history of a browser(gchrome, ffox, ie) using java.... thank you! ;) | |
OK, i'm working on a hangman game in cmd prompt. I'm about halfway done, but i have hit a wall regarding the secret word, and the user guess. Now mind you, my professor has not taught the class any array manipulation methods or techniques for finding specific char in an … | |
Hi, I've got an error message on "public static void save_data" and "public static void retrieve_data". Please help, thanks [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; public class face1 extends JFrame implements ActionListener { JPanel pm,menup,fp,f1p,f2p,f3p,f4p,f5p,pf_1,pf_2,pf_3,pf_4,pf_5; static String f1[] = new String[2]; static String f2[] = new String[2]; … | |
Hello, I havr created a program in which there are two classes. One ship, and shooter. However it is not working. Any idea? [CODE] package shooter; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.KeyEvent; public class Ship implements Runnable { int x, y, xDirection; boolean shoot = false; boolean ready … | |
Hi @all! I have a array with three numbers: num[0] = 5 num[1] = 2 num[2] = 5 I need to find out which of these numbers are the largest ones, it could be one, two or all of them, and need the index. Here for example "0 and 2". … | |
I am new to programming. My code are listed below. [CODE]public abstract class Mark { private double mark; public double getMark() { return Mark; } public void setMark(double mark) { this.mark = mark; } public abstract void calculateMark(double x, double y, double z); }[/CODE] [CODE]public class Test extends Mark { … | |
what are requirements for sql server 2005 installation? how to connect it with netbeans> can we make no. of instances?how and why? | |
I am doing a cross-site ajax to java data transaction(Not sure if I named that correctly, so please forgive me about that). Part of code in Java file: [CODE]BufferedReader input = new BufferedReader(new InputStreamReader(connectionsocket. getInputStream())); DataOutputStream output = new DataOutputStream(connectionsocket.getOutputStream()); ... output.writeChars("some random text"); output.close();[/CODE] Also I have index.php file … | |
Hi all, Im new to java. I get this error. Non-static variable this cannot be referenced from a static context myClass c=new myClass() ^ this is my code [CODE] public class MyOwnBm{ private Hashtable myHash=new Hashtable(); public static void main(String[] args) { myClass c=new myClass(); c.match(); } public class myClass{....} … | |
Why i am getting this error ERROR at line 5: PL/SQL: SQL Statement ignored Here is my code CREATE OR REPLACE PROCEDURE SELECT_VEHICLE_VEHICLE_TYPE (vehicletype IN VARCHAR2, vname OUT VARCHAR2, vtype OUT VARCHAR2, efirstname OUT VARCHAR2) AS BEGIN SELECT v.V_NAME INTO vname,v.V_TYPE INTO vtype,e.E_FIRST_NAME INTO efirstname FROM VEHICLE_TABLE v INNER JOIN … | |
I'm getting error messages when I run my program. The problem is as follows: Design a Payroll class that has fields for an employee's name, ID number, hourly pay rate, and number of hours worked. Write the appropriate accessor and mutator methods and a constructor that accepts the employee's name … |
The End.