32,199 Topics
| |
I need to fix the code. Once a war event takes place, no points are assigned however in the next deal whoever wins (be it the player or computer) should get double points. One point for the war and the second point for the next deal that was won as … | |
Hi, This is my first post, I usually find solution by searching this forums However, I been working on my problem for 6 hours with no solution. Here what I'm trying to do I have a class that extends as JPanle also it implements ActionListener I'm trying to add JScrollPane … | |
Define a class called ‘twoInt’ with two public integer fields a and b In the constructor of ‘twoInt’, initialize the a and b to be 1 and 2 Create an instance ‘mytwoInt’ in the main method Write a method ‘swap’ (not the method of the class ‘twoInt’) and pass the … | |
so lets say you finished your program. you made the GUI and it runs fine. so everytime you want to run your program you have to go to python(or what ever you use) lauch it to see your program. my question is what code or what do you have to … | |
hi. i have some questions..howtowrite a program that convert numbers to their equivalent words? example. 123 become one hundred twenty-three in 3 different language. | |
hi, i need help with bubble sort. i am not sure what are variable j and variable sort are for? public static void bubble_sort(int unsorted[]) { int i = 0; int j = 0; int sort = 0; while(sort == 0) { sort = 1; j++; for(i = 0; i … | |
Ok so i made a game in which a random no. is generated and user have to guess it. The game givesclues like Higher or Lower to user. When a guessed no is found a new jframe opens in a new class gui.class. Now i want to pass the argumets … | |
Trying to write a for loop to insert buttons into the array. This is the code to create an array that can hold 7 values: JButton[] buttons = new JButton[7]; String[] buttonText = {"Circle", "Square", "Oval", "Smiley", "Swirl", "Start", "Stop"}; This is the for loop I'm not sure about to … | |
Trying to change the size of the shapes over time. Making them bigger as they move upwards and to the right, and making them smaller as they move downwards and to the left. This is the class that contains the move method: import java.awt.*; import javax.swing.*; import java.util.Random; public class … | |
Hi :-/ I have a java function that I want to call inside my JSP page. My function has got parameters.Now the problem is I cannot call it using JavaScript and if I put it inside <% %> tags it just executes while loading the webpage itself. I need to … | |
Bellow is what i have so far on my assignment. I need some help getting this application working. Thank you for your time! /** General Assignment: Review the grading policy on the CSCI 181 syllabus. The course grade is determined by the weighted average of six components with two possible … | |
Could someone please give me an idea of why I get a nullPointerException when I run this method in my main program. Every list has a variable, first, to store the address of the first node of the list. I assign current1 to the first node of list1 as a … | |
String testHTMLContent = testhtml+productlogo; Message message = new MimeMessage(session); message.setFrom(new InternetAddress(usern)); message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to)); message.setRecipients(Message.RecipientType.CC,InternetAddress.parse(ccaddr)); message.setSubject(sub); //message.setText(body); // setDebugMsg("Attempting to send..."); Transport transport = session.getTransport("smtps"); MimeMultipart mimeMultipart = new MimeMultipart(); MimeBodyPart msgContent = new MimeBodyPart(); msgContent.setContent(testcontent, "text/plain"); mimeMultipart.addBodyPart(msgContent); MimeBodyPart query = new MimeBodyPart(); query.setHeader("Content-Type", "text/plain"); query.setContent(queryString, "text/plain"); mimeMultipart.addBodyPart(query); MimeBodyPart htmlPart = new … | |
Hi there, What i'm trying to accomplish is: These two methods: f(x : double) : double post: return x integral(og : double, bg : double, step : double) : double post : return (f(og) + f(og+stap) + … + f(bg)) * step So I can call those two in my … | |
I have an interesting problem. I am working on a method that iterates through a number of simple java arrays stored in an Object array. The goal of this method is to find the smallest array contained within the Object array. Because these collections are stored in an Object array, … | |
I am working on a program where I am trying to solve a tree structure using the Node function I have to perfomr a arithmetic operation example ((1+2)*3) using a tree structure with left and right child. the complexity being I need to randomly generate the constants as well as … | |
HI ! could you please help me here? i'm having a problem on marking the books in my library program if it is borrowed or returned? here's where im at, import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; import java.awt.Color; public class Library { ArrayList<String> bookName = new ArrayList<String>(); {{ … | |
public class Thread7 implements Runnable { public static void main(String r[]) { Thread t = new Thread(new Thread7()); t.start(); public void run() { System.out.println("C"); System.out.println("D"); } System.out.println("A"); try { t.join(); System.out.println("B"); } catch(Exception e){} } } Query1: On compiling this program I get "illegal start of expression" error pointing to … | |
THing is I have an assignment where the object is an array, I need to check when it is out of bound. But I dont understand what this statement means? Can you guys help me verify it? > method "private void rangeCheck(int index)": if the value of index is less … | |
I am having a problem completing this Java program. Basically everything is complete and running correctly except the end (which I cannot figure out the code for). The point of this program is to convert dates from the "Month Day, Year" format to "DD-Mon-YYYY" format and increment the dates by … | |
Hello everyone. I have this program to write for my college course. I listed the instructions below. The problem I have is the starting point. I don't know where to begin. Would it make sense to have a class called Sports, class called mySports, and then classes such as Basketball..etc … | |
I got the insert and Delete Data/Row working for my DBMS. The deleteRow method finds the row that contains the same primary key from the database, passed on to the method, and deletes the row. With using the insertRow method, the data I added shows on up on the last … | |
hello everyone, Ive been trying to alter strings and i am having a very difficult time altering the vlaue after i split them. i understand what i am doing when i split the input(String[] word = phrase.split(" ");), thanks to this site.. and how i am then able to alter … | |
Whats the best way to port a Java web service to a C# web service? Multiplatform. Thanks | |
I'm attempting to use the ObjectOutput/InputStream to write data to a file; I'm fairly certain I've got the out portion but coming back in isnt working as it should, thoughts? public static void writePersistant(ArrayList<PersistantObject> persistantRecords) { try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("dataout/population-record.ser")); for (PersistantObject i : persistantRecords) { … | |
college academic controlling all departments i want new ideas to this project in java. | |
I am trying to create a simple AI (for four in a line). I have looked online and found a few complicated AI's but they were to complex for me. I am trying to use recursion and maxDepth to create an AI to play two moves ahead. public class AIMove … | |
So i have a class that takes 2 generics types: public class Something<K,V>.... In another class, i'm trying to create an array of Something objects. how do i do this? i'm getting an error with this: Something <K,V>[] s = (K,V[]) new Object[size]; | |
Hello, I would like to retieve data into my combobox. I have done this so far but when I click on the button it's not giving me anything: public void displayItem(int data1) { String sql = ("select * from Students limit ?,1"); try { st = (PreparedStatement) con.prepareStatement(sql); st.setInt(1, data1); … | |
This is the error i get.. Enter employee name: Bryan Enter employee's salary: 123 Enter employee name: Mark Enter employee's salary: 456 Enter employee name: Fajutag Enter employee's salary: 789 Enter employee name: qwe Enter employee's salary: 32 Enter employee name: qew Enter employee's salary: 312 Enter employee name: qew … |
The End.