32,199 Topics

Member Avatar for
Member Avatar for solahere

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 …

Member Avatar for micahli123
0
3K
Member Avatar for nyfan68

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 …

Member Avatar for nyfan68
0
188
Member Avatar for nyfan68

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: …

Member Avatar for nyfan68
0
208
Member Avatar for vishnukumar

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 …

Member Avatar for vishnukumar
0
726
Member Avatar for slman

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 …

Member Avatar for stultuske
0
98
Member Avatar for nyfan68

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 …

Member Avatar for stultuske
0
391
Member Avatar for mehnihma

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( …

Member Avatar for peter_budo
0
5K
Member Avatar for london-G

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?

Member Avatar for london-G
0
82
Member Avatar for jet101

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.

Member Avatar for jet101
0
209
Member Avatar for sugir1987

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 { …

Member Avatar for NormR1
0
163
Member Avatar for djescobar

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); …

Member Avatar for djescobar
0
230
Member Avatar for FDRSOURCE

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 …

Member Avatar for JamesCherrill
0
181
Member Avatar for mehnihma

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() == …

Member Avatar for mehnihma
0
160
Member Avatar for krejar

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, …

Member Avatar for JamesCherrill
0
121
Member Avatar for kubaikev
Member Avatar for jade_91

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 …

Member Avatar for NormR1
0
259
Member Avatar for Hypnos_16

[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. …

0
116
Member Avatar for ganesanronaldo

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 …

Member Avatar for ganesanronaldo
0
241
Member Avatar for rob211

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 …

Member Avatar for JamesCherrill
0
99
Member Avatar for MrMansanas

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! ;)

Member Avatar for peter_budo
0
191
Member Avatar for uzii305

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 …

Member Avatar for uzii305
0
374
Member Avatar for RinzLove

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]; …

Member Avatar for stultuske
0
743
Member Avatar for london-G

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 …

Member Avatar for london-G
1
132
Member Avatar for rob211

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". …

Member Avatar for rob211
0
176
Member Avatar for xyxtss

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 { …

Member Avatar for stultuske
0
134
Member Avatar for parulparashar

what are requirements for sql server 2005 installation? how to connect it with netbeans> can we make no. of instances?how and why?

Member Avatar for stultuske
0
104
Member Avatar for kolibrizas

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 …

Member Avatar for kolibrizas
0
224
Member Avatar for coroll

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{....} …

Member Avatar for JamesCherrill
0
487
Member Avatar for codex89

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 …

Member Avatar for thines01
0
138
Member Avatar for mags11

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 …

Member Avatar for NormR1
0
3K

The End.