32,204 Topics
| |
i tried using this where ros and cols is an integer which is equals to 8 [CODE]if (i == ros || j == cols) { if (i == ros && j > cols) { cols++; } else if (i == ros && j < cols) { cols--; } else if … | |
| Hey, Can you please give an solution of why this doesn't work correctly? [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * */ public class Main { static Thread hare = new Thread(new ThreadRunner("hare",90,100)); static Thread tortoise … |
hey guys! as the title hints at i'm having a problem with updating a table so just to give you an idea of the issue i'll give you a quick idea of what the JTable is expected to do(this is all coded but i'll save you some time and summerize) … | |
[code]import javax.swing.*; import java.awt.*; import java.awt.event.*; class CelsiusTemperature extends JFrame implements ActionListener{ private double readingInCelsius; private JButton button; private JTextField field; private JTextArea area; private JLabel label; public CelsiusTemperature(){ setSize(500,200); setLocation(250,150); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); label = new JLabel("Celsius"); field = new JTextField(20); button = new JButton("Convert"); area = new JTextArea(10,20); Container container; … | |
So I'm suppose to create a JUnit test for 3 classes... each method should have its own test case... I've created the test classes, but I don't know how to code the actual tests. Here's one class that I have to create a test for, and the test class I … | |
Does anyone know of or have a website where you can upload your applets and other people can play them? (like kongregate for flash games) and maybe even make some money every time someone plays your game? If you're wondering why, I need money for school. 0.o | |
Can someone help me with these codes. I'm trying to validate the date(e.g if the users entered February 31, which is not an existing date, the program should give an exception output). Aside from this, we are required to do our own exception. Thank you! [CODE]class MyDateException extends Exception {} … | |
Hi y'all. I'm looking for feedback and discussion on the use of annotations to eliminate the boilerplate code for linking buttons and methods. Hopefully this will be especially useful in RAD or rapid prototyping environments. Over the weekend I hacked together a little proof of concept that supports two ways … | |
I have a program,but there is an error, please help me, thanks program to include six string data (name of city), then do the sorting of the six cities data and print data before and after sorting. but in terms of input data strings, there is an error, please help, … | |
problem in importing javax.mail.internet; can any one please help | |
The result of this below only print out John 90 Shawn 100 Melalin 75 Jane 80 What i want is Melalin 75 Jane 80 John 90 Shawn 100 I tried all methods but still can't think of how to make it arrange from the lowest score to the highest. Can … | |
Create a class that represents the grade distribution for a given course. In this class you should write methods to perform the following tasks: Read the number of each of the letter grades A, B, C D and F Set the number of letter grades A, B, C, D and … | |
Write a Payroll class that uses the following arrays as fields: [LIST] [*]employeeId. [*]hours. [*]payRate. [*]wages. [/LIST] [U]employeeId.[/U] 5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489 I should have two classes: [LIST=1] [*]Asn07Employees [*]Assignment07 [/LIST] *I am to use arrays and not vectors Here is some skeleton code that my instructor … | |
[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * VideoStreamingform.java * * Created on 29 Mar, 2011, 7:01:42 PM */ package audivideotransmit; import javax.media.MediaLocator; import javax.swing.JOptionPane; /** * * @author ajay */ public class VideoStreamingform extends javax.swing.JFrame { … | |
Hi, i wanna develop web-based system. use PHP to send data to database.but, from database i use the data to be processed by java application then send back to database.my problem is i cant relate the user and java application.so,im thinking of sending directly data to java application and at … | |
Hi, everyone i have a problem in displaying Jlabels and Icons in a single JPanel. I have used Gridlayout and tried to display the Icons and JLabels in the JPanel. But using GridLayout the JLabels and Icons get dispersed and not in proper order and also the icon get crop, … | |
Hello, I'm having trouble displaying an output from my code. It suppose to act like a stopwatch where seconds increment and then minutes and then hours but for some reason its not working and I cannot figure out why... :-( hope some some can guide me. Thanks [CODE]/* * To … | |
I need help position a bunch of things. Mostly the text bar. Here's my code: [CODE] package swingHW2; import java.util.Scanner; import javax.swing.*; import java.awt.*; public class swingHW2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub // The Layout FlowLayout lout = … | |
Here's what I got. A linkedList of objects of Customer class of different account types (Savings,current and fixed). Each Customer object has a LinkedList of transactions(another class) as an attribute. 2 types of transactions can be made i.e Debit(withdrawal) or Credit(deposit). Given: A savings account can go into negative while … | |
Here is the output that I should be receiving: [CODE] Please enter the name on the check (First Last): John Doe Please enter the amount for the check (as a float): 123.45 --------------------------- Pay to : John Doe $123.45 one hundred twenty three dollars and 45 cents[/CODE] Now, what I … | |
This bit of code im working on is supposed to print the inputted string in steps minus 1 letter every time. ex. BANANA BANAN BANA BAN BA B Here is my code: [CODE] Triangle triangle = new Triangle(); //test driver triangle.triangleLoop("BANANA"); //test driver public void triangleRecursive(String input){ String recursiveInput = … | |
Is it possible to create javaBeans dynamically instead of writing each get and set per jsp property, they generate themself? | |
[ICODE]import java.io.*; import java.util.*; class MyClass { public static void main(String s[]) { int a,b; a = Integer.parseInt(s[0]); b = Integer.parseInt(s[1]); System.out.print("Hello World \n"); } }[/ICODE] I'm getting the following error " Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at MyClass.main(Myclass.java:8) " Someone please help me out..... | |
Hey everyone the program I am writing has to find the mode, max, and median from an array. I think I have everything except there is one error I cannot figure out, thanks in advance. [CODE] import TerminalIO.KeyboardReader; public class med { public static int MAX(int[] a) { int MAX … | |
hy friend i want a simple example of keyborad event handling . how i call the the keylistener interface method which are implemented in another class, from main method of program. Second when i press any key from keyboard then the keycode and charachter are displayed thanks | |
I have created 3 files: SmsInbox, SmsGetData and SmsMsg. I don't know if I set this up right. I want Phonenumber, message and time to be stored in the Jlist and when I double click it It will print out the phonenumber, message and time. How do I print it … | |
is it possible to use a jsp page with a java bean to get values dynamically. ie: the name is incremented each time but i need the gets and sets for each property to get their values and set them on the bean, can i do this dynamically? Thanks [CODE]<td><p … | |
Hello java programmers, I want to draw some squares on layers using Graphics2D, course. Here is my source code with problems: [CODE]import java.awt.*; import java.util.ArrayList; import java.util.List; import javax.swing.*; public class Draw extends JPanel { private static final long serialVersionUID = 1L; private List<Cube> cubes = new ArrayList<Cube>(); public static … | |
I'm trying to write some code that will write certain variables to a text file and create a simple record system. So when a button is clicked the variables are calculated and written to a text file. How can I set it up so that when the button is clicked … | |
On a project I am currently working on, we are supposed to differentiate between different classes of users based off their IDs (which are 10 digits). For example, one group's IDs should all start with a 9 (marking them as belonging to that group) and the other groups should start … |
The End.