32,199 Topics
| |
Hi everyone! I have written a server client that receives information, does a database transaction and then sends the result back to the client. My client has requested that they be able to view what was received and what was sent in real time. I have used a JTextArea. The … | |
I am building a program to make a pyramid as such. 1 1 2 1 1 2 4 2 1 Etc. For 8 rows. [CODE]public class PrintingNumbers { public static void main (String [] args) { int k = 1; for (int i = 1; i <= 8; i++) { … | |
My classes compile but for some reason, I always get false when I try to add a student to a course. could someone please help me? [CODE]public abstract class Student extends Person { protected Course[] courses; protected final int maxCourses = 4; protected int numCoursesEnrolled; protected double gpa; public Student(String … | |
I'm wanting to convert this part of the pseudo-code... [quote] start string name string address num item num quantity num price num SIZE = 6 num VALID_ITEM [SIZE] = 106, 108, 307, 405, 457, 688 num VALID_ITEM_PRICE [SIZE] = 0.59, 0.99, 4.50, 15.99, 17.50, 39.00 num sub string foundIt = … | |
Hey everyone, I am new to the site and to programming so please be gentle. I am working on a simple project where I use pre-created classes that define shapes and call the methods within them to create a picture on a canvas. I have most of this down, but … | |
Ihave written the below pieces of code, but i am not able to solve the compilation error here as it shows the error as ArrayOutOfBoundsException error. so please tell me hw to remove the error and please bring the necessary changes. [CODE] import java.util.*; public class Cipher { private int … | |
i am doing the coding of my minor project and for that i need to convert an input text(String) to an int type as i am inputting the data through swing component, panel as text(string). But internally i need to process that as int. so please tell me how can … | |
hey, i cant set the size of a frame to a particular dimension.My code is :- [CODE]public class ImageShow extends JFrame{ ResultSet r; Image img; public ImageShow() throws SQLException { setTitle("Image retrieved"); JPanel panel = new JPanel(); //setSize(500, 500); setDefaultCloseOperation(HIDE_ON_CLOSE); Container pane = getContentPane(); panel.setLayout(new GridLayout(3,3)); r=ImageRetrieve.rs; while (r.next()) { … | |
[CODE] public static void main(String[] ar) { ..... int N = Integer.parseInt(args[0]); ..... } [/CODE] Error is : Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 | |
Hey everyone, I recently had the assignment to write a recursive program to calculate greatest common denominator. I barely understood recursion when our instructor explained it to us. I understood how it works and calling on itself I am just bad at implementing it. I think I almost got my … | |
hi, I want to make an application in java to visualize on graphic the network (the name and addresses of local servers of the company ... for example) using the tracert command, if any one can enlighten me that idea, because Internet is a wide world. | |
| can someone help me how how can catch CTRL C and print it out then stop the program? Thanks [CODE]/** * 218-102 Lab 7 * TestCircle.java * * @author JKang & JLeone * */ import java.util.*; import java.awt.event.*; import javax.swing.*; import java.awt.*; public class TestCircleB { public static void main(String … |
how to backup mysql database using java and store backup file into my current directory of source code. | |
Hi All, I have PDFs that are to be watermarked. I need to know whether there exists the below options 1 Option is : Whether we can rewrite the same file with the logo instead of taking the existing pdf and writing this pdf into watermarked file option2 : Whether … | |
can we use JAVA and php together ??? or struts and drupal together | |
I want to create a regular expression that matches with the string "B. Hello" or "C. Hello" and so on.. I tried number of things and finally came up with this [CODE]String REGEX = "[A-Za-z]"+Pattern.quote(".")+" Hello";[/CODE] but still no luck.. I tries using '\s' for space but still not working. … | |
Hi guys well I have a problem on my JFrame which is once I click on my List all Videos button it displays my data from my MS database which all works well. However as you can see from the png the query results are not aligned up correctly together … | |
i have created program below ,but it does not run successfully why [CODE]import java.sql.*; public class Bank { public static void main(String[] args) throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // TODO code application logic here try{ Connection cn=DriverManager.getConnection("jdbc:odbc:rushiDSN"); System.out.println("Connected Successfully"); Statement stmt=cn.createStatement(); stmt.executeUpdate("CREATE TABLE Author(AuID Number(3), AuName Char(15), AuAddr Char(30))"); System.out.println("Table created … | |
Hello I'm writing a little program to check if a postal code is valid or not and I'm using while loop and if statement this is the code: [CODE]final String REGEX = "[A-Z&&[^DFIOQU]][0-9][A-Z&&[^DFIOQU]] [0-9][A-Z&&[^DFIOQU]][0-9]"; output.println ("Please Enter a Valid Postal Code: "); String postal1; String postal2; boolean isCorrect = false; … | |
So, I have multiple classes modeling a university. I have Student which has subclasses GradStudent and UndergradStudent. I also have a course class. I am having issues figuring out what to pass to add and drop students and to add and remove courses. I keep getting errors like this: ./Student.java:39: … | |
hi Got 2 questions. 1.How can i simplify 4 variables all with same condition? if a,b,c,d <1 System.out.println("Invalid input");? How to put this in a simple code?I know it can be done individually. 2.if the above condition is false i dont want my code to go further and calculate the … | |
I would like to move the mouse cursor from one position to another within a Jtextfield after a condition is satisfied. I do not know what to use. Thank you | |
Hello guys. I'm wondering is it possible to stream mp3 songs from some site with java? I tried to find something but allways everything what i found was only for reading mp3 songs from local disk. If you know feel free to answer me. - Regards, David. | |
My professor told me these things are wrong:1) For getting the "#" sign in your board, you need to call the createTicTacToeBoard() method to create the board. The returning type of the method is char[][] createTicTacToeBoard() not the string, and you don't need to pass any array into this method … | |
please check the following piece of code and give the correct code as my program is showing some error. here is the code. public class passingArray { public int getCipherText(int[] c, int len) { int cipher = 0; int e = 7; int n = 130; cipher = (int)((Math.pow(c[len],e)) % … | |
Hi guys well my code is below I am trying to set up error checking so that CREATETABLE will only execute when String v and string d are false and when string t is true. I've started the code. Which it works when String v or String d are null … | |
Hi! I use scanners delimiter. The next() function for scanner should return me the string by these punctuators: | . : space But i don't know what to write inside scanner.useDelimiter("") parameter? For example for this string "abc.123,zqw ttt|AAA", scanner.next() should return abc scanner.next() should return 123 scanner.next() should return … | |
can you please tell me what is make and what is use of it Can you also tell me what is meaning of a given statement "Apache Ant is a Java-based build tool. In theory, it is kind of like make, without [B]make's wrinkles"[/B] | |
hi i want to display column in jtable but the columns enter each other and reduce the size of the columns so how i can when i display larger number of columns apper with each column has itis own space | |
Hi, I want my output to show to two decimals.If the output is $6.075,instead of bring it to $6.08,i prefer it showed $6.07.How am i able to do this? I used the below System.Out but kept getting $6.08. [ICODE]System.out.printf("%s%.2f\n","State Withholding(9.0%):$",stateWithholding);[/ICODE] Thank You :) |
The End.