32,204 Topics
| |
Hi, I have an XML file looks like this <node> <node2><node3>1</node3></node2> <node2><node3>2</node3></node2> <node2><node3>3</node3></node2> </node> I am trying to read one child into a string I want my string to look like that : <node2><node3>1</node3></node2> [CODE] File xml = new File("json.txt"); SAXReader reader = new SAXReader(); Document doc = reader.read(xml); Element … | |
Hello, My question is if I have program programmed by matlab and I want program an interesting interface using another program language such as java ,can I do that? Please give me suggestions about programming wonderful interface using matlap or any other language can integrated with matlap because the original … | |
Hello, I am creating simple an applet to draw a registration form based on the selected item within the awt choice object. I have include a radio button, choice list and button. My problem is when running the Applet...the choice list is blinking and when I maximized or minimise frame … | |
I have a problem with sockets. I am using this code in java as the client: [CODE] class Javaclient { private static DataInputStream input; private static PrintStream output; public static void main(String argv[]) throws Exception { int PortNumber = 4321; String line; BufferedReader in; Socket MyClient = null; try { … | |
Hi guys well what I'm trying to do is produce a query that only produces the results which will match my director input. I have looked for the correct syntax and cannot seem to find it. Any help would be appreciated Code of my syntax below: [CODE] ResultSet results = … | |
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)) % … |
The End.