3,978 Topics

Member Avatar for
Member Avatar for Fazle

I am being tasked to record TCP data and play them back with same speed. I am able to record tcp data but struglling to playback with same speed. If someone can help will be greatly appreciated. My codes below are reading TCP data and writing them in minute files …

0
42
Member Avatar for haseena04

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import java.io.*; import java.text.*; import java.util.regex.*; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; class Clustering1 { public static void main(String[] args) throws IOException, FileNotFoundException { int diff_matrix[][] = new int[500][500]; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the data file name\n"); String fname=br.readLine(); …

Member Avatar for javaAddict
-1
160
Member Avatar for haseena04

import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; import java.io.*; import java.text.*; import java.util.regex.*; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; class Clustering1 { public static void main(String[] args) throws IOException, FileNotFoundException { int diff_matrix[][] = new int[500][500]; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter the data file name\n"); String fname=br.readLine(); …

Member Avatar for javaAddict
0
85
Member Avatar for puppykillaz

I am getting an error message that is quite new to me. I normally can call methods without incident but this time, I saw a new error message. This code is sample coding I am using to see how to fix three of my issues. First Class [CODE] public class …

Member Avatar for puppykillaz
0
315
Member Avatar for Fisher78

Write a program that simulate a die roller. The user should type in the number of the throws. Let the program count how many ones, twos, threes... are in the series. In the end the program should write down how many ones ... that was and also figure out the …

Member Avatar for javaAddict
0
122
Member Avatar for ceyesuma

Hello The ActionPerformed will not unload the viewPort to load the new viewPort that holds a table. is there a way to reload the table? The first actionPerformed supplies the table but the next will not remove table and add the new one. [code] package view.content.panels.guide; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; …

0
58
Member Avatar for zango

So the following is where I think the problem lies in my code: [CODE]public void actionPerformed(ActionEvent i) { int temp; double newtemp = 0; String inputString; inputString = infield.getText();//pulls the number that was entered in the input field temp = Integer.parseInt(inputString);// makes a new variable to handle the input //tells …

Member Avatar for javaAddict
0
755
Member Avatar for extemer

guys me trying to use switch statement in this program but cant get to end... i tryed to convert string into char but dont knw why it still not getting right... please help me [code]import javax.swing.*; import java.io.*; class HappyBirthday { public static void main(String[] args) throws IOException { String …

Member Avatar for extemer
0
256
Member Avatar for idlackage

Probably a stupid question, but I need the 'colour' variable for an external class, and it can only return something when it's declared in the constructor. However, the colour returned would then never change. Is there a way to return values from the change listener, or anything else that I …

Member Avatar for JamesCherrill
0
526
Member Avatar for Fazle

My above code is reading TCP data and writing them in minute file under recording directory as follows: /WSIGraphicRecord3/recordings_dir /WSIGraphicRecord3/recordings_dir/20100512133155.ws /WSIGraphicRecord3/recordings_dir/20100512133256.ws /WSIGraphicRecord3/recordings_dir/20100512133357.ws /WSIGraphicRecord3/recordings_dir/20100512133457.ws /WSIGraphicRecord3/recordings_dir/20100512133557.ws /WSIGraphicRecord3/recordings_dir/20100512133658.ws /WSIGraphicRecord3/recordings_dir/20100512133800.ws /WSIGraphicRecord3/recordings_dir/20100512133900.ws /WSIGraphicRecord3/recordings_dir/20100512134001.ws /WSIGraphicRecord3/recordings_dir/20100512134101.ws /WSIGraphicRecord3/recordings_dir/20100512134202.ws /WSIGraphicRecord3/recordings_dir/20100512134302.ws /WSIGraphicRecord3/recordings_dir/20100512134403.ws /WSIGraphicRecord3/recordings_dir/20100512134503.ws /WSIGraphicRecord3/recordings_dir/20100512134603.ws Now my question is how to playback these files with same speed? I am able to …

0
55
Member Avatar for Lass

Hello everybody, I'm working in a java interface and I'm trying to use an image as a background but nothing from the result I found in the internet seems to work well with me :/ my code is: [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import java.awt.Color; public class …

Member Avatar for Lass
0
91
Member Avatar for lich

im my java SE application i have a messagebox prompting asking the user to press OK. i want to make the user wait a certain time and the messagebox will automatically close in a certain time. i read on swing.timer about this. but im bit confused with the implementation. how …

Member Avatar for JamesCherrill
0
163
Member Avatar for sfrider0

I found an application that gets the source from a webpage. That worked fine. I tried converting it to an applet, and it works great in netbeans. The problem is when I try to run it in a browser, it does nothing. As you can see from the code, I …

Member Avatar for sfrider0
0
130
Member Avatar for vanpersie

Hi I have two classes the first inherits the second which should retrieve records of a table found in an oracle database as a jtable but it display table header only! can anyone help me to know the problem please ? [code] import java.sql.*; import java.util.*; import javax.swing.table.*; public class …

Member Avatar for vanpersie
0
119
Member Avatar for bettybarnes

hi everybody! i have this code for queues but it doesn't execute due to final Queue s = new Queue(); what should i do with this? pls help me :( [CODE]// Testing the Queue class of the java.util package import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class QueueTest …

Member Avatar for sergb
0
216
Member Avatar for kvass

Hey guys~! I am working on a code and I am having some difficulties with it -- Basically I have a 3x3 grid of JButtons that represent the squares on a TicTacToe grid. The code seems to run fine but then after it determines a victor it crashes and says …

Member Avatar for BestJewSinceJC
0
474
Member Avatar for aneeqahmed

I am doing my home work in which i have to pass values from java text field to text text file. My code of program is given below. The problem is that the program is not passing values from text field to text file. Please help me. /** * @(#)GUITest.java …

0
44
Member Avatar for cnuchavez

Hello folks, I recently started learning Java and bought a book to look at some examples. When I copied this example program out of the book I get a null pointer exception. Most of the other programs worked perfectly this is the only one iv had a problem with so …

Member Avatar for cnuchavez
0
167
Member Avatar for Lordson60

i need help, for some reason i cannot remove items that i have added to my JPanels the welcome.remove will is causing a problem [CODE]// The "RunescapeCalc" class. import java.awt.*; import hsa.Console; import javax.swing.*; import java.awt.event.*; import sun.audio.*; import java.io.FileInputStream; import java.math.*; public class Game1 extends JFrame implements ActionListener { …

Member Avatar for Lordson60
0
266
Member Avatar for pradeep_09

How should i handle click events of a JButton array i have frame containing 100 JButtons .I need to find out which one was pressed by the user[code]import java.awt.*; import java.awt.event.*; import java.sql.*; import javax.swing.*; public class Screen1 implements ActionListener , WindowListener { int i; JFrame scrfrm1; JLabel lblscr; JButton …

Member Avatar for n88y
0
198
Member Avatar for ku95

Here I have a program and I'm getting the following error ControlPanel is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener public class ControlPanel extends JPanel implements ActionListener ^ I don't fully seem to understand how the best way is to overcome this? [CODE]import java.awt.*; import javax.swing.*; …

Member Avatar for moutanna
0
3K
Member Avatar for bettybarnes

hi everyone can u please correct the errors in these codes? [CODE] // Testing the Stack class of the java.util package import java.util.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class StackTest extends JFrame { public StackTest() { super( "Stacks" ); Container c = getContentPane(); final JLabel status = new …

Member Avatar for moutanna
0
243
Member Avatar for jasneg16

Please help me out with this... Sorry, Don't know how to post in coding option. this might be hard to understand. | I just copy it and posted it.... thanks in advance. /* * To change this template, choose Tools | Templates * and open the template in the editor. …

Member Avatar for moutanna
0
133
Member Avatar for ku95

Hi, I have some code for a program that I'm doing. Basically I'm trying to write method whereby the reset() method takes two parameters which are number of columns and number of rows. I'm doing this method whereby I have to to move all the contents of the Connect4Model constructor …

Member Avatar for quuba
0
109
Member Avatar for sfrider0

I've created a link checker in the past that checked all the links on a web page. I created it in C#, then made it work for an asp.net page. I've taking a Java class since then. I found this code on the internet that is supposed to check the …

0
77
Member Avatar for Hodson

I have created a very simple Tic Tac Toe game using NetBeans 6.8. Swing is used in order to create the grid. I can build and run the game with no problem. What I now want to do, is have this uploaded onto a website (along with other applications I …

Member Avatar for Hodson
0
269
Member Avatar for ku95

Im currently working on a Connect4 progrqam and I'm trying to convert a string into an integer. You will see that it is under the Connect4View. Its really frustrating as I'm struggling to find a way round this. Is there a possible solution to this and can someone please tell …

Member Avatar for ku95
0
162
Member Avatar for RossMc

Hi, I need to create this Carpark application that looks like this [url]http://i35.photobucket.com/albums/d171/rossmc/java-1.jpg[/url] I have got the buttons to work but when I try to make the grid it is not showing with the buttons when I run it. This is the code I have so far. Does anyone know …

Member Avatar for masijade
0
131
Member Avatar for AFB

this erorer message appear to me when i run projact --------------------Configuration: afb - JDK version 1.6.0_17 <Default> - <Default>-------------------- Exception in thread "main" java.lang.StackOverflowError at sun.awt.Win32GraphicsConfig.getBounds(Native Method) at sun.awt.Win32GraphicsConfig.getBounds(Win32GraphicsConfig.java:215) at java.awt.Window.init(Window.java:393) at java.awt.Window.<init>(Window.java:432) at java.awt.Frame.<init>(Frame.java:403) at java.awt.Frame.<init>(Frame.java:368) at javax.swing.JFrame.<init>(JFrame.java:158) at Convert.<init>(Convert.java:10) at Convert.<init>(Convert.java:115) at Convert.<init>(Convert.java:115) at Convert.<init>(Convert.java:115) at Convert.<init>(Convert.java:115) at …

Member Avatar for quuba
0
243
Member Avatar for vextorspace

I have a JFrame that I call from another JFrame like so: [CODE] Viewer2D v = new Viewer2D(this); v.setVisible(true); v.DrawAssembly(glNameList.get(hitRecs.get(0).getNames()[0])); [/CODE] I set the exit action to an action listener and call dispose() and both of my JFrames disappear! How do I get only the one I'm working on to …

Member Avatar for BestJewSinceJC
0
88
Member Avatar for tedsu

I am trying to add Jtext area to a Java application, load text from a Notepad file & allow user to change color of text & make text invisible/visible using Menu bar. I am having trouble with the 1st part--loading the contents of a text file. Any help would be …

Member Avatar for moutanna
0
159
Member Avatar for Roegadyn

Hello everyone, I have work to do on a basic assignment that requires an ATM type of program working over XMLRPC so there is a server element where the data is held in a Hashtable and retrieved by a client form. I will state I am completely lost in the …

Member Avatar for Roegadyn
0
149
Member Avatar for runee1000

[CODE] import java.awt.*; import java.awt.geom.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; //need this for the timer to work. ///public class DoubleBuffering extends Applet implements MouseMotionListener class Ship { private int xpos, ypos, height, width, speed, xdir, ydir; private Ellipse2D.Double c; public Ship(int x, int y, int w, int h, int …

Member Avatar for quuba
0
880
Member Avatar for BobbieJean

I've got this applet to build with no errors but then I try to run it and when I click the button in the applet, nothing happens...at least, not in the applet. Instead, jGRASP gives me all this stuff and I don't understand a bit of it: ----jGRASP exec: appletviewer …

Member Avatar for ragedsparrow
0
226
Member Avatar for ghostrida45

My program complies fine but whenever I run it the applet loads but its blank and at the bottom it gives me Applet Not Initialized. I have no idea whats causing this if someone could help me out would be greatly appreciated. The Errors im getting are: [QUOTE] at javax.swing.ImageIcon.(init)(ImageIcon.java:167) …

Member Avatar for BobbieJean
0
295
Member Avatar for mozly

I followed a tutorial and built my own little program but get this message: Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(Unknown Source) at Gui.<init>(Gui.java:27) at appls.main(appls.java:6) What to do? Here is my code btw [CODE]import java.awt.FlowLayout; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JOptionPane; …

Member Avatar for mozly
0
86
Member Avatar for beckveg

Hello everyone I want to run a .jar file, but the only way to run in my computer is with the "java -jar file.jar ", but the problem is that the application conects to a mysqldatabase, when I want to add something in the program appear a message that say …

0
121
Member Avatar for grady-lad

Hi I am doing a lab where I have to print out all of the locales when the JButton is pressed but when I run the program all it does is show the Vietnamese locale anyone any suggestions how to show them ALL ? [CODE] import java.awt.*; import javax.swing.*; import …

Member Avatar for moutanna
0
69
Member Avatar for BobbieJean

I've gotten this applet to do some of what it should but I'm having trouble getting it to do the rest. It's a multiplication applet that asks the user a question such as "What is 6 times 7?", has a JTextField for the user's answer, and a JButton to check …

Member Avatar for quuba
0
110
Member Avatar for BobbieJean

Hi, I'm having a hard time getting my applet to even build right. Here are the instructions my instructor gave: [I]"Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit integers. The program should …

Member Avatar for BobbieJean
0
421
Member Avatar for AFB

java.awt.*; import javax.swing.*; import java.awt.event.*; class Getaction implements ActionListener{ String am = ""; String req ; String em = ""; String oper = ""; double x,y ,result; String res; Addcomp get = new Addcomp(); public void actionPerformed(ActionEvent ev){ req = ev.getActionCommand(); if((req.equals("1")) ||(req.equals("2"))||(req.equals("3"))||(req.equals("4"))||(req.equals("5")) ||(req.equals("7"))|| (req.equals("8"))||( req.equals("9")) ){ if (oper == …

Member Avatar for Katana24
0
141
Member Avatar for psomis

hallo guys.i am newbie at java and i want ur help. i have created the 5 five buttons but not the action listeners for them. the five buttons are : add person, see ll persons, search a person,update a person, delete person.so when i press add person the programm should …

Member Avatar for psomis
0
2K
Member Avatar for BobbieJean

Hi, I'm having a hard time getting my applet to even build right. Here are the instructions my instructor gave: [I]"Develop a Java applet that will help an elementary school student learn multiplication. Use the Math.random method or a Random object to produce two positive one-digit integers. The program should …

0
77
Member Avatar for musikluver4

I have spent over a WEEK trying to figure out why my code isn't working. It's a long code, I will post it all but I will break down the code as I explain. First off, I have called double[] arrays and then initialized them later on in the program …

Member Avatar for musikluver4
0
3K
Member Avatar for rena0514

my teacher wants the tictactoe game to have a button called play that resets the tictactoe game my button doesn't work....what did i do wrong? [CODE] //TicTacToePanel.java Author Carien Anderson //Represents tic tac toe game board and allows peer to peer competition import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JOptionPane; …

Member Avatar for javaAddict
0
2K
Member Avatar for bigBob888

Hello all, I am new to java and programming. You will be able to tell that by my post. I have a program that needs to take info from my textField and store it in an 2d array. Then do calculations and output the calculated data into a textArea. So …

Member Avatar for Ezzaral
0
126
Member Avatar for geteducated

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 …

Member Avatar for masijade
0
1K
Member Avatar for DrApe1

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 …

Member Avatar for DrApe1
0
118
Member Avatar for sinister747

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 …

Member Avatar for sinister747
0
90
Member Avatar for ku95

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 …

0
41

The End.