35,619 Topics
![]() | |
I made an arraylist of objects which contain a question and an answer... How can I display just the question? Sooooo confused. Tutorials or anything will help, thanks in advance. [CODE] /* text file */ T Which Java keyword is used to define a subclass? extends S What is the … | |
Ok so I am writing this GUI menu and one of the choices on the menu requires the user to log in. So I open a new window that prompts the user for a username password. However after the user inputs the information how do I just close the window? … ![]() | |
[ICODE]import java.util.Random; public class Card { public String cardGeneration() { Random generator = new Random(); int x; // random integer representing suit int y; // random integer for card value String mysuit, mynumber; //assigning names, these will be changed int suits = 4, numbers = 13; //depending what card is … ![]() | |
can someone help me and tell me what is wrong, I can't figure it out. This is what it is exactly saying Lab424.java:14: cannot find symbol symbol : method printf(java.lang.String, float) location: class Lab424 printf(" sum %f\n", sum); it is pointing to the "p" [CODE]import java.util.Scanner; public class Lab424 { … | |
hi, am working on a bigger project than this, only using this as an example because i do not want to waste a lot of your time. i have this code, its supposed to write to the database, but have no idea as to what i should put under action= … | |
Hello, I was tasked to make a program that reads data from a text file and then place it into a JTable. I managed to read the file and split the strings but I don't know how to put the strings into a format accepted by JTable. Please help. This … | |
This is my project and I have the code below.....Create a class that simulates the functionality of a simple car. You can do simple things like drive, add gas and honk the horn. Simple text messages are displayed on the screen for feedback when appropriate and ALWAYS include the make … | |
Is there an actionMap-like thing for mouse clicks? Thank you in advance, ive tried google, but did not find anything :/ | |
I am currently doing some writings to an excel file (.xls) through JExcel API. My problem is about the autoSize method of CellView. My code. [CODE] public void write() throws IOException, WriteException { File file = new File(inputFile); WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook = Workbook.createWorkbook(file, … | |
can someone help me and tell me what is wrong, I can't figure it out. It is pointing to the line "public class Lab4.24" [CODE]import java.util.Scanner; public class Lab4.24 { public static void main(String[] args) { int i; float sum; i=3; sum=0; while(i<=99) { sum=sum + ( (i-2)/i); i=i+2; } … | |
I downloaded mysql-connector-java-5.1.18 and put it on my USB drive. I brought my USB drive to school and opened up Eclipse, in there I added an external .jar (the mysql-connector-java-5.1.18.jar). Then I wrote this java code: [CODE] import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Scanner; public class Main … | |
Hey guys! I'm trying to make a GUI program. The program can take a picture from the computer, then the user can tag certain areas and input names. When the user hovers over the area where he/she tagged, it would show the name of the person tagged. And also, the … | |
Hi, I'm seriously guessing here, but since I've seen that some php websites contain java stuff, like a java chatroom, I wonder if I can find a better solution adding some java to my php code. I'm looking for a way to browse and select a folder, or allow the … | |
So I know of two methods of reading or writing files in java. The first is the read(byte[]) method provided by InputStream class. The second is the readLine or write() method provide by the Buffered prototype. Which is the more efficient one out of these? Which one would you recommend? | |
So my java pprgram is actually a GUI I did all of it except I cant figure out how to convert between bases example: number=2239 base=3 newbase=4 first i need to convert 2239 to base 3 which would be 2 * 3^3 + 2* 3^2 + ..... then convert that … | |
Hi, i've a problem with my codes, when ever i run it, i got an error from the checking i implemented. Can some pls explain why does the error keep coming. [CODE]import java.net.*; import java.io.*; public class EchoClient{ static final int serverPort = 1026; static final int packetSize = 1024; … | |
Hello fellow developers, Let me just start by saying I have had an abnormal start to developing. I started first with HTML > PHP > Java. I don't have much experience with Java but I feel quite confident in making PHP applications. I have already searched the forums but nobody … | |
As we know [LIST] [*]ServletContext [*]HttpSession [*]HttpServletRequest [/LIST] are interface in JSP SERVLET api of Java..! We repeatedly use it in our code for different purposes, but i am still confused where and in which class all abstract method for given interfaces are implemented ? Like setAttribute, getAttribute , removeAttribute … | |
[CODE]RequestDispature red = request.getRequestDispature("xyz"); red.forward(req,res);[/CODE] in this simple example RequestDispature is INTERFACE..! "red" is reference for that , but whose instance it actually holds ??? "forward" and "include" methods are of RequestDispature interface...but where they are implemented ??? in which class ?? which class implement this interface ??? Can anyone … | |
Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to … | |
I got dinged points for these: Instructor wants 1. The class is divided into multiple methods, mentioned a Constructor instead? 2. The toString method is included in the Card class to return the face and suit. What did I do wrong? How do I fix it? I am pretty lost … | |
Hi, so I'm new with Java and the programming thing. Here's my problem. I need to do an errortrap without using a loop and creating a method solely for errortrapping so I figured i need to use try and catch statements but I'm not sure how. Basically my problem is … | |
Hi, I keep getting the error message "Missing return statement" after my if else controls. I have return controls, I'm just not sure if I can implement multiple returns. For example, I am trying to create a method in which the middle value of a sequence of numbers is returned, … | |
Hi, I am a complete newbie when it comes to programming, the only real knowledge I have was when I created a program 3 years ago in Visual Basic. I guess I know the theory behind programming concepts but have no idea what to do in Java. Not sure if … | |
Hi, I am trying to make an array to read txt files. I have hard coded it to 3 for the array but I would prefer for it to be able to read the txt files to see how big the array should be. I have implemented some code to … | |
Hi guys, I want to find the sum of numbers(inclusive) between TWO integers inputted by user. Example: if user enters 1 and 4, then it outputs: Sum = 10 I just started my code: [CODE]public static void main(String[] args) { int number1 = 0,number2 = 0,Sum = 0; Scanner input … | |
![]() | I don't know what am I doing wrong, When I input number of courses it won't loop again just once? What is wrong with the code? Thanks [CODE] // EX 3 import java.util.*; // program uses class Scanner public class ComputeGpa { public static void main(String args[]) { // create … |
Hi there, I am currently studying Java just over six weeks and am a novice. I have been give a question to do, the question is... Theatre Ticketing System Write a program that reads ticket details from the user and outputs those details in the form of a Theatre ticket … | |
I want to return the value of i, but I don't know how. My code is: [CODE]public int indexOfFile(String filename) { int value=0; for(int i=0; i<DRIVE_SIZE; i++) { if(drive[i]!=null && drive[i].getName().equals(filename)) { value= i; }else{ value= -1; } } return value; }[/CODE] so I want the value of i, but … | |
[CODE]import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.PostMethod; public class sslRequest { public void run(){ String url = "https://pipeline.sbcc.edu/cp/home/login"; try { HttpClient client = new HttpClient(); //client.getParams().setParameter("http.protocol.single-cookie-header", true); // client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); PostMethod method = new PostMethod( url ); // Configure the form parameters method.addParameter("user", "username" ); method.addParameter("pass", "password123" ); method.addParameter("uuid", "********-f08d-4d64-aeef-************"); // Execute the POST … |
The End.