32,204 Topics
| |
public static void nonRecursiveInorder(Node node) { Stack<Node> st=new Stack(); st.push(node); Node temp; while(!st.isEmpty()) { temp=st.peek(); if(temp.left!=null && temp.left.visited==false) st.push(temp.left); else { if(temp.left==null && temp.right!=null && temp.right.visited==false) { System.out.print(" "+temp.value); temp.visited=true; st.pop(); st.push(temp.right); } else { if(temp.left!=null && temp.left.visited==true && temp.right!=null && temp.right.visited==false) { System.out.print(" "+temp.value); temp.visited=true; st.pop(); st.push(temp.right); } else … | |
Hey Guys , can i just get some help with my dialog box , a sterr in the right direction wil be brillant . Thanks guys import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ButtonGroup; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JDesktopPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; … | |
Just looking at my entries in my Process Explorer and I noticed the JAVA updater was in there. I turned that off. So I went back to the JAVA console and indeed it was on. I turned it off and it gave me a warning and again I chose to … | |
Hi, I have a working program and I need to answer the following questions: 1:where was polymorphism was used in this application? 2:identify where overriding or overloading was used in this application? I belive overriding is used by the Runnable method to override the run() method. Would that be a … | |
HEllo everyone... My project consists of drawing a road two lane road using grahipcs the code snippet below is for drawing the road however if someone can help me in executing theses codes on an interface woud be great because i dont know how to do it Cheers public Road(int … | |
new to I.T. need help about the problem analysis ,algorithm design, formatting the output package gasolinestation; import javax.swing.JOptionPane; public class GasolineStation { public static void main(String[] args) { float total, money; String yesno; JOptionPane.showMessageDialog(null, "Welcome to Gasoline Station!"); do { String select = JOptionPane.showInputDialog(null, "1 = Diesel .................... $ 39.00\n" … | |
Just a quick heads-up, especially for anyone using Java in their web browser. There's a "widely exploited" vulnerability in Java that could allow bypassing normal security when a Java applet is run silently upon visiting a web site. (ie It's a bad one). Users are being widely advised to disable … | |
Hello if anyone can help I would like to know why I get this error when executing.. exception in thread "main" java.lang.NuSuchMethodError: main [code] import java.awt.*; import java.awt.event.*; import javax.swing.*; public class GridLayoutFrame extends JPanel { // These are the components private JButton FindB,AddB,RemoveB; private JLabel theOne,theTwo,theThree,theFour,studentID,theMidTerm,theMidterm,theFinal1,theFinal2,FinalG1,FinalG2,FGrade2; private JList studentNumbers; … | |
Hi there everyone, I have a bit of a problem I am hoping you can help with. This is for an assignment, and I know I can finish the final calculations for my tax program if I could just pass my 2 variables from previous methods into the final method … | |
Hi everbody, Seen posts saying simple dictionary in Java. Thought of sharing something may be useful for others. Here is a simple code if anyone interested. import java.util.*; public class Dictionary { public static void main(String[] args) { Map <String, String> dictionary; dictionary = new TreeMap <String , String>(); Scanner … | |
Hello, I was trying to make a client-server application using java orb. Server was fetching data from database and passing them to client. The client was getting an exception for large numbers of rows (say, 50K). Jan 15, 2013 11:48:51 AM com.sun.corba.se.impl.transport.SocketOrChannelConnecti onImpl readFully WARNING: "IOP00410215: (COMM_FAILURE) Read of full … | |
Hello I am a student of computer science year 3 and am doing my project on a **road design simulator**. I should be able to design a road on a java interface and simulate it with cars. Does anyone have an idea about how should i proceed with it? | |
write a program to print the highest palindrome value that is the multiplication of two numbers lies between 100 to 1000. | |
I'm supposed to write an application that calculates the Body Mass Index (BMI) for the user, using centimeters for height, and kilograms for weight.. Basically, I'm stuck here.. I have no clue what I'm supposed to do next.. Or if it's even correct so far.. Any help? /*** This application … | |
This is the code which i wrote.But when i input a word,it should search it and give the definition.I think there is a problem in while loop.But i can't solve it.Can u guys,plz check it? [CODE]import java.util.*; class dictionary { public static void main(String args[]) { Hashtable dict = new … | |
Hi everybody, Just wondering if it is possible t hat we can change the text size in balloon or bubble message or whatever you call it the one we create useing "trayicon.displaymessage("message", "message", message.info);Highly appreciate if someone could help me out. Thanks. | |
PROBEMS: > The Library class would include data members such as ID, Date of acquisition, description, number of copies, title and **instance methods such addItem() and retrieveItem()** also accessor and mutator methods are needed to accecss data members. > User arrays to store library holdings. So here's my questions: **What … | |
Hi, I am new to Java. Recently I developed one application for Uploading files to Shared drive. All files are Uploading properly but Checksum Of PDF files are mismatching. Someone please help me to fix this issue Thanks in advance. | |
hi i need the code to calculate the euclidean distance by reading a yeast dataset file when the calcute button is clicked it show the distance between different points in another frame | |
This is my Problem, Please Help me :( The Library class would include data members such as ID, Date of Aquisition, descrition, number of copies, title and instance method such addItem() and retrieceItem() also accessor and mutator method aree needed to access data members. These are variables and methods common … | |
This is a part of my code. String name=sc.nextLine(); int no=sc.nextInt(); The problem is if I write sc.next() instead of sc.nextLine() then i can pass only "james" not "james watson". when i write sc.nextLine() then it takes integer not string.Why is it so? Please Help!!! | |
hi i need to create a batch file when it is double click it should run the code | |
having a little trouble trying to convert this pseudo code into python, could any help receiveFile () { lastblock := 0 newblock := 0 ; repeat repeat event := getFrameFromUDP(m) ; case event of data : newblock := getBlockNoFromFrame(m) ; transmitAckOverUDP(newblock) | timeout: transmitAckOverUDP(lastblock) esac until newblock==lastblock+1 ; lastblock = … | |
/ // Clipper.java // // /** * Object for performing clipping * */ public class clipper { /** * clipPolygon * * Clip the polygon with vertex count in and vertices inx/iny * against the rectangular clipping region specified by lower-left corner * (x0,y0) and upper-right corner (x1,y1). The resulting … | |
Hello, Iv recently just started using javafx and i am struggling finding a way to access data from a controller class, at the moment i can do it using method.invoke, however it seems like more of a hack than a legitimate clean option of accessing data from a controller class. … | |
Hello I'm planning to create a java application which calculates ip address just like this http://jodies.de/ipcalc?host=172.168.0.2&mask1=23&mask2= can you suggest an existing library, or tutorials so I could begin developing this? | |
| |
Hello I'm currently working with my Java program here is my code: import java.util.Scanner; public class StringAct{ public static void main(String[]args){ Scanner inp=new Scanner(System.in); System.out.print("Enter string: "); String a= inp.nextLine(); if(a=="angel"){ System.out.print("Valid"); } else{ System.out.print("Not Valid"); } } } this program asks the user to enter a string, the string … | |
HI! I want to write a constructor that will make a window (a frame). I want to be able to insert the height, width, position and window color. This is what I've written: public Window(String name, int height, int width,String c,String isActive,int PointX, int PointY){ setTitle(name); setSize(height,width); getContentPane().setBackground(Color.c); setLocation(PointX,PointY); setVisible(isActive.equals("active")); … | |
Hi there everyone, I am a novice at java and this one has me stumped. This is the beginning of a tax calculator but I am getting irregular output from the getIncome() method. It starts fine, letting the user enter income figures, but on the third income entry or so, … |
The End.