32,204 Topics
| |
import java.io.*; public class k { public static void main(String args[])throws IOException { k s1 = new k(); s1.menu(); } public void menu()throws IOException { int input = 0; System.out.println("Pick from 1 of the following Options"); System.out.println("1) Twelve"); System.out.println("5) Exit "); System.out.println("Enter Number: "); BufferedReader br; br = new BufferedReader( … | |
Hi Folks, I have to print the error with line and error name using log4j property file so what property should i put in log4j property file so i will print error with line numbers! Regards, Rajeshwar. | |
any help me plz regarding gradients and i had already some of the tools in paint like smude,eraser etc | |
[code] public void addRowsAntGrouping(){ Vector vectorAddRow = new Vector(); vectorAddRow.add(""); vectorAddRow.add(""); ((DefaultTableModel)jTableAntGrouping.getModel()).addRow(vectorAddRow); } [/code] Hi, I am in need of replacing the textfield of a table with combobox. the rows in the table are declared as vectors. there are two fields in the table. the first field is text and … | |
Hi, I understand, Socket.setkeepalive() enables the user to keep the socket alive. Here is an extract from the SocketOptions interface from the Sun site about the SO_KEEPALIVE variable: When the keepalive option is set for a TCP socket and no data has been exchanged across the socket in either direction … | |
We are supposed to read data from a file like [COLOR="Green"]2 2 0 0 w d d w 0 1 w w d d 1 0 d w w w 1 1 d w x d[/COLOR] The first two numbers represent the column and rows the rest of next two … | |
Here is the preorder: [code=java]private void preOrderTraverse(Node < E > node, int depth, StringBuilder sb) { for (int i = 1; i < depth; i++) { sb.append(" "); } if (node == null) { sb.append("null\n"); } else { sb.append(node.toString()); sb.append("\n"); preOrderTraverse(node.left, depth + 1, sb); preOrderTraverse(node.right, depth + 1, sb); … | |
Dear Friend, I am new in Jave. right now I am learning APPLET but When I am trying to use THREAD in applet its giving the following warning after compilation. Note : Java Uses or Overloads a Depricated API. Note : REcompile with -XLint : Deprication for details. Tool Completed … | |
I have a student class and also a cohort class. I need a command to find a certain student aStudent, bStudent etc but are unsure of the right way to do it Thanks in advance [import java.util.*; public class Cohort { private static int groupSize = 15; private HashSet aCohort; … | |
i posted a problem here a while back on doing a program, and i got the help i needed... but i'm faced with another problem. this code seems to be working fine but i want it store the values i entered into another text field... i cant seem to figure … | |
Hey everyone, I've written an application with an animation using the Timer object. In order to stop the animation I call the stop method of the Timer class. From what i've read this just pauses the timer. My problem is that if i display the animation once it displays well. … | |
I have these two classes Maze and MazeCell. I have a problem with the Maze constructor in Maze Class and do not know how to access it, or test it. Does Maze N = new Maze(row, col) do anything. I know it's supposed to set it as the length of … | |
Hello, guys. I'm very new to Java and this is my first time I'm actually programming by myself. I have a homework due soon. Anyways, my question is: Write a program that asks the user for a word to replace in some text, and the word to replace it with. … | |
Dear all, I have these code below (netbeans) : All cells in columns "saldo Awal" are set to 58000000000.00, but appear in cell is 5.8E9 What should I fix in my code ? Thanks, Kusno import javax.swing.DefaultCellEditor; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; import java.awt.Component; import java.text.NumberFormat; import javax.swing.JTable; import javax.swing.JOptionPane; import … | |
how do i reset the applet? i thought that it would work if i call the method itself thanks [code=java] private class ButtonListener1 implements ActionListener{ public void actionPerformed(ActionEvent e){ myButton1.setBackground(Color.black); int answer = JOptionPane.YES_OPTION; answer = JOptionPane.showConfirmDialog(null, "BOOOoooM!!! Would you like to play again?", "", JOptionPane.YES_NO_OPTION); if(answer == JOptionPane.YES_OPTION){ LoanApplet … | |
I have to write an applet that asks the user to enter two floating-point numbers, obtains the two numbers from the user and draws their sum, product, difference and quotient. This is what I have so far. Can anyone make sure I am on the right track. import java.awt.Graphics; // … | |
Hi All, I have 2 classes. say Class A and Class B. My logic is coded in a method in class B. I am accessing this method of class B by creating an instance of class B in class A. To explain better: Class A{ ClassB b = new ClassB(); … | |
public class myMutableTreeNode extends DefaultMutableTreeNode { // tree nodes rendered as JTable } public myWin extends Jframe() { // constructor top = new myMutableTreeNode(); jTree1=new JTree(top); .................................. // nodes are added to tree and rendered as jtable // On “save” menu option, I want to save this Jtree1 using XML … | |
The following code is what I have so far. I know there are errors in some parts, because i'm currently still workin on them. However, I am having trouble invoking the reduce() method. The purpose of the program when im done is to be able to add and multiply fractions … | |
Well this is a lab assignment, the problem I'm having is that the sample code he gave us is suppose to run as is, but it doesn't. I email him and he thought that most likely there might be a problem with the CLASSPATH for java or that I might … | |
I've made some changes to the JavaScript that powers DaniWeb today. Can those of you who have JS/AJAX/DHTML disabled please enable it and let me know if it corrects the speed problems you were having. Thanks! | |
I am passing information between two forms. Up to now, I have passed information from one form to another. Is there another way to do this? [DisplayDie dpDie = new DisplayDie(dp); // Getting constructor error in this line DisplayPanel dp = new DisplayPanel(dpDie,dpDie);] When I swap the lines, error moves … | |
I'm having trouble with a switch statement [code=java]Scanner scan = new Scanner (System.in); char chars = scan.nextLine(); System.out.println("A Andorra\n" + "B Belgium\n" + "F Finland\n" + "M Malta\n" + "S Slovenia\n\n" + "Choose a country from menu above:\n" + chars); switch (chars) { case 'A': System.out.println("You chose \"Andorra\""); break; case … | |
Here is my code package prg420.week5; //Creates the package import java.util.*; class Grades { //Creates the class for the variables private double grade1; private double grade2; private double grade3; private double grade4; private double grade5; public void setGrade1(double val) { grade1 = val; } public void setGrade2(double val) { grade2 … | |
Hello All, I really hope that someone can provide some assistance. I have read a XML file into my hashtable. Next I created a second hashtable. If a key is located in my first hashtable, I want that key along with its value to be inserted into the second hashtable. … | |
Hello people, I'm new here and new to java also... My only programming experience is in C, but now I have to do some work in java. First, the problem is: My input is an image file that contains different routes from a source to destination. (I have attached the … | |
I am not sure how to fix this problem. I am trying to pause the display after the first 15 lines until the array ends. /* Week 4 Individual * Programmer: Melissa Snider * Date: 4/6/2008 * Calculate the mortgage payment for 3 loans with an array */ package prg420.week4; … | |
Hi, Could someone point out ways on how I could reload the frame? so far, what I've done : [code]int more = JOptionPane.YES_OPTION; more = JOptionPane.showConfirmDialog(null, "BOOOoooM!!! Would you like to play again?", "", JOptionPane.YES_NO_OPTION); if(more == JOptionPane.YES_OPTION){ myFrame.setVisible(true); } else{ myFrame.setVisible(false); } [/code] I'm not sure what I should … | |
Dear all, How do I validate cell value in jTable ? I want users to input numeric value in cell. Thanks, Kusno | |
Hello, After having a list created from objects of a certain Class. I wish to sort the contents. How do I do this? This is my case: _bkgList = new ArrayList(); for(int i = 0; i<10; i++){ BookingResponse bkngRes = new BookingResponse(); bkngRes.setAwbNum(awbNum); bkngRes.setOrigin(origin); _bkgList.add(bkngRes); } As you can see, … |
The End.