32,199 Topics

Member Avatar for
Member Avatar for Connavar3

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 …

Member Avatar for Connavar3
0
410
Member Avatar for mrbaconbitts

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++) { …

Member Avatar for mrbaconbitts
0
126
Member Avatar for gatorgirl

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 …

Member Avatar for DJSAN10
0
137
Member Avatar for Torf

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 = …

Member Avatar for Torf
0
157
Member Avatar for Hattoff

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 …

Member Avatar for JamesCherrill
0
238
Member Avatar for adil_bashir

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 …

Member Avatar for adil_bashir
0
168
Member Avatar for adil_bashir

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 …

Member Avatar for adil_bashir
0
181
Member Avatar for nidheeshkumar.r

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()) { …

0
80
Member Avatar for adil_bashir

[CODE] public static void main(String[] ar) { ..... int N = Integer.parseInt(args[0]); ..... } [/CODE] Error is : Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0

Member Avatar for adil_bashir
0
92
Member Avatar for MrHardRock

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 …

Member Avatar for MrHardRock
0
302
Member Avatar for kalcio

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.

Member Avatar for kalcio
0
144
Member Avatar for mehnihma

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 …

Member Avatar for mehnihma
0
9K
Member Avatar for rushikesh jadha

how to backup mysql database using java and store backup file into my current directory of source code.

Member Avatar for peter_budo
0
115
Member Avatar for arathy nair

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 …

Member Avatar for peter_budo
0
368
Member Avatar for bhallarahul
Member Avatar for bhallarahul
0
102
Member Avatar for DJSAN10

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. …

Member Avatar for DJSAN10
0
176
Member Avatar for TIM_M_91

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 …

Member Avatar for DavidKroukamp
0
120
Member Avatar for rushikesh jadha

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 …

Member Avatar for rushikesh jadha
0
256
Member Avatar for moe0

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; …

Member Avatar for DavidKroukamp
0
73
Member Avatar for gatorgirl

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: …

Member Avatar for stultuske
0
3K
Member Avatar for Valiantangel

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 …

Member Avatar for DJSAN10
0
87
Member Avatar for jkembo

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

Member Avatar for jkembo
0
638
Member Avatar for MicroD

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.

Member Avatar for RicardoE
0
1K
Member Avatar for dsmith12

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 …

Member Avatar for DavidKroukamp
0
152
Member Avatar for adil_bashir

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)) % …

Member Avatar for DavidKroukamp
0
234
Member Avatar for TIM_M_91

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 …

Member Avatar for TIM_M_91
0
237
Member Avatar for servet

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 …

Member Avatar for JamesCherrill
0
122
Member Avatar for bhallarahul

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]

Member Avatar for ~s.o.s~
0
150
Member Avatar for lena1990

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

Member Avatar for mKorbel
0
74
Member Avatar for Valiantangel

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 :)

Member Avatar for hfx642
0
102

The End.