32,204 Topics

Member Avatar for
Member Avatar for gatorsgirl

Hello everyone, I am looking for some assitance with an assignment that requires a user to input tutor time and earnings into a gui and then calculate the totals and averages in a text area. I have succeeded in getting the program to work, however it is totaling the user …

Member Avatar for NormR1
0
218
Member Avatar for skiabox

I am trying to create an oval shape using Netbeans but the oval shape never draws itself. Here is the code : /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package learn; import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; /** …

Member Avatar for NormR1
0
168
Member Avatar for jarograv

I have these 2 classes: [CODE]import javax.swing.JOptionPane; public class Theatre2D { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub // declares an array of integers int[][] myTheatre2D; // allocates memory for 2*10 integers myTheatre2D = new int[2][10]; myTheatre2D[0][0] = 20; myTheatre2D[0][1] = …

Member Avatar for jarograv
0
1K
Member Avatar for DavidKroukamp

Hey all, I have been busy building my own chess game and as of now im a bit stomped. Well you see i have an object Board, this object will be initiated and it will create a new frame with various panels one of them being the panel which holds …

Member Avatar for JamesCherrill
1
244
Member Avatar for jouj

i want to know how to add put images or array of image (icon) in a JList any helpp .

Member Avatar for SasseMan
0
115
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
727
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
392
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
213
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
166
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
118
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
243
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
745
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
133
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
177
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

The End.