36,051 Topics
![]() | |
plz help.....in solving this problem While developing the Virtual University Learning Management System (LMS), there was a requirement stated that: “Students should be able to post their questions on MDB of LMS, so that it may help them to clarify their concepts in case of any confusion, after they have … | |
Hi please help me with paging as i am searching it for last 3 days but no success I have a table in JSP ,which is getting values from java / database and displaying record via beans here is my JSP code [CODE]<logic:iterate name="list" id="user" scope="session"> <tr><td><beanOld:write name="user" property="username" /></tr></td> … | |
So I have an array and I need to get the values of it that are larger than a set integer. It would be something like this apart from it doesn't work due to different data types. [code]myVariable = array[i]>otherVariable;[/code] where myVariable and otherVariable are integers. Any help? | |
Hello all, This is a very simplistic simulation but i'm hoping to show bacterial growth using this simple piece of code. [CODE]public class Bacteria { boolean living; Bacteria x; int population; public void spawn() { living = true; try{ Thread.sleep(2000); } catch (InterruptedException e ) {} Fission(); try{ Thread.sleep(100000); } … | |
Is there no such thing as hasNextChar? I'm trying to make a program to figure out a grade point average, and a solution I've come up with to deal with the +/- is to assign it as a char and give it a value from there, but I run into … | |
I made a flowchart that will print counting numbers 1-10 automatically, and I'm supposed to print their sum and average at the end. Now, I have to convert the flowchart into three Java programs: For, While, DoWhile. I'm having a bit of a problem on the flowchart and the programs. … | |
Hey .. Everyone ... I'm now to java .. I'm trying to figure out .. how everything fits together .. well .. i have a project that I'm working on .. .. basically it a type of quiz working on java .. where a user takes a simple MCQ quiz … | |
Thank You .. EveryBody .. for Your Support .. Finally Got my Project Working again .. Now.. Im facing Only 1 Problem .. The JRadioButtons .. Remain selected even when I get to the next Question .. the Previous selection .. remains .. Selected.. any help how i can .. … | |
The question is asking: A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20 random die tosses and that prints the die values, marking the runs by including them in parentheses, like this: 1 2 (5 5) 3 1 4 6 1 … | |
[CODE]import java.io.FileReader; import java.io.IOException; import java.util.Scanner; import java.util.Arrays; import java.util.NoSuchElementException; public class ReservationBook { private Reservation[] data; public Reservation[] readFile(String filename) throws IOException { FileReader reader = new FileReader(filename); try { Scanner in = new Scanner(reader); boolean done = false; while(!done) { try { int numberofR = in.nextInt(); data = … | |
I am sort of told that O(c^n) complexity could be the case of string permutations. but what is this specific 5^n? can anyone think of a simple algorithm with O(5^n)?thx | |
I have a ArrayList and JTable load Object from ArrayList to display on table. When i sort table by using method: [CODE]table.setAutoCreateRowSorter(true);[/CODE] by using that method, i can sort table by clicking on header of the column i want to sort! But after sort, the Object of row which i … | |
I have Brought a voucher For SUn JAva EXAM ,So where do u register for this exam ,cant find any links on SUN site And WHICH SUN JAVA EXAM should i give first SCJP OR some other??????????? | |
here is some code from one class... [CODE]public boolean ticketStatus(){ if (fine > 0){ status = true; } else{ status = false; } return status; } [/CODE] and this is from another class... [CODE]public void getTicket(){ if (parkingticket.ticketStatus()){ toString(); } else{ System.out.println("you do not have a ticket. "); } } … | |
Hi all, I am using java bean class in my web application(it is not extending servlet).My need is to get the context path of the application in that class.If yes how. I am using "./".It doesn't work. Please help me | |
Currently working on a project where we have a message board server. I've gotten most everything to work except my last part where we want an arrayList that returns Oldest Messages and one for newest messages. Here is what I have so far and have tweeked and commented out some … | |
Hi, I need to know if we can use the if satament with methods and how? and what is the illegal start of expression? | |
The problem: Java will not install on my laptop. My laptop was purchased a little over three and a half months ago. It is an eMachines 440-1394; Windows 7, two Gb RAM, 250 Gb HDD When I purchased the laptop, I was able to install openOffice (with Java? I am … | |
I am trying to implement a stack where one can push to the front and to the back of the stack. However, my implementation is very slow. Can anyone help me think of a better method? Thank you! [CODE]public class Pch11_x1 { /** * @param args the command line arguments … | |
I can't seem to find out why it doesnt work with average or smallest but largest and sum does work. //constructor public class DataSet { private int sum = 0; private int count = 0; private int Smallest; private int largest; public DataSet() { } public void addValue(int a) { … | |
I'm using a JTable with a DefaultTableModel. I use the Load Button for populating the JTable. Anyway, the problem I have is with the Delete row button. (defaulttablemodel.removeRow). This is the whole project: [code=java] package proiect1; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import java.io.*; import javax.swing.event.*; import javax.swing.table.TableModel; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; … | |
Hi.. this is my code: [code] import java.util.Scanner; public class Arrays { //private variables private int[][] list = new int [12][2]; private int highest; private int lowest; //public functions Arrays(){ highest = 55; lowest = 5; list = new int[12][2]; } public int getData(){ Scanner input = new Scanner(System.in); for … | |
How can I develop IPhone games with Java? I've tried something called XMLVL but that doesn't seem to be up to date and I can't use it because they don't have anything I can download to use... So is there any other alternative? | |
I can't get my userName variable right, it prints out user name the first time, but the second time it prints out null...I've been at this same problem for nearly 24 hours. [CODE]import java.util.Random; import java.util.ArrayList; import java.util.Scanner; public class mlab { // instance variables - this instance will get … | |
if i have a text file with data: test, 1, 2 again, 3, 4 Can someone give me an idea how to start puting each line into an object ? ObjectName o = new ObjectName(String s1, String s2, String s3); [CODE] class Action implements ActionListener { public void actionPerformed (ActionEvent … | |
hi everyone, i need some help implementing some functions into my code. Right now, all it does is have a rectangle appear on the screen and I can change its color via the radio buttons. I'm thinking I need some sort of grid/cells on the left side of the panel. … | |
I am having problems with the output of my program The program is to design a classed named Employee. The class should keep the following information in fields: Employee Employee number in the format XXX-L, where each X is a digit within the range of 0-9 and the l is … | |
When I try to run the file I get this error, amen't sure how to fix it. [CODE]Exception in thread "main" java.lang.IllegalArgumentException: illegal component position at java.awt.Container.addImpl(Container.java:1035) at java.awt.Container.add(Container.java:408) at EmailWindow.CreateContent(EmailWindow.java:65) at EmailWindow.<init>(EmailWindow.java:22) at Lab6a.main(Lab6a.java:10)[/CODE] Heres my code sorry for lack of comments [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public … | |
hey, can anyone help me with these comlexity problems? I tried with myself but still want some clarifications..cheer,here is the code: [CODE](a) public void printPow2(int[] values) { for (int i = 1; i < values.length; i *= 2) System.out.println(values[i]); } (b) public void maxDifference(int[] values) { int max = 0; … | |
i want to know how to put the path in the fuction Naming.lookup ("//...."). suppose that i want to call the remote object in 2 cases: 1. server and client stands on local machine for example remote object and sever stands in folder c:\rmi i want the exact path please … | |
Hey guys, I'm new here and a n00b in Java, trying to figure things out though :) I want to make a polygon move in a Java Applet but I keep struggling with the keylistener (aka it doesn't do anything) Maybe someone can help me please? Here's my code: (I'll … | |
Hi, I have a text file that I'm going to read, and then parse it. After parsing it, how do I return it into it's original position or layout as before? Because now after parsing it, my output is printed out individually, instead of printing it out how it looks … | |
I am writing a toString method where a it returns three integers. If any of them are less than ten I have to add a zero before the number. For example if I had the variables 5, 6, and 2 it would read 05:06:02. I really can't figure out how … | |
Hey, Iam trying to write a java application that acts as a one-word Pig Latin translator. The program should: 1.ask the user to enter a word 2.convert the entered word into proper Pig Latin translation, (I have to use a method named translate to get the Pig Latin translation of … | |
I am using microsoft access as my database. When i click on the button Enter Details nothing happen. Please suggest where the mistake is. The doGet method contains the following code [CODE] super.doGet(request, response); String Name = request.getParameter("txtName"); String Designation = request.getParameter("txtDesignation"); Connection con = null; PreparedStatement pstmt = null; … | |
Ok, I'm getting a little confused on how to do this. Basically i got N stacks of cards. And need to check the topCard of every stack and check that N - 1 cards match then remove them. I peeked every stack of cards to get the top card, and … | |
Right now Iam writing a program that will convert english into piglatin. Ans I have pretty much finished the program, but Iam stuck and need help. When I run the program, nothing happens after I type in the users input. What am I doing wrong. Heres my code, [code]import java.util.Scanner; … | |
My question is... what is the int times for? i dont understand what i am supposed to do with it. Here are the instructions about this method: String[] generate(String symbol, int times) In this method you should use the grammar to randomly generate the given number of occurrences of the … | |
I am writing a program that reads text but must ignore case, spaces and punctuation while evaluating a string for palindrome. When I use the following the case issue is solved. [CODE] String str = ""; if (str.toLowerCase().charAt(LHS) != str.toLowerCase().charAt(RHS)) [/CODE] ...but when I use the following I get IndexOutOfBoundsException … | |
I have an application I'm making... And it has a canvas in it. The problem is, on the y axis, my canvas is offset by ten pixels downward and I can't figure out why. You can see what I'm talking about in the screenshot. Do you know what's wrong? | |
Hi, i only know the Java basics and really need help! I have a class called temporaryHolder which holds an arrayList of 54 cards. However, I need to get elements out of this arraylist and need to add them to stacks in another class. Q1) How can I access all … | |
hi all, I want to call a class function using beans inside java script. but it is not working. It calls that function only 1 time. [code] <jsp:useBean id="track" scope="session" class="ReturnProgress"></jsp:useBean> <script type="text/javascript"> function getProgress() { document.getElementById('progress').innerHTML = '<%=track.findProgress()%>'; } </script> [/code] I want that Whenever user clicks on button … | |
Hi! I've decided to open a new thread for discussing the problem with uploading a file to a SUB-FOLDER at the FTP Server. So, I'm using Apache Commons library and I can upload my file to the Home Directory of the FTP server. However, if I want to upload it … | |
I have this problem when i create a sortable JTable with data load from an ArrayList! My project is Student Management and i add some function like Add/Edit/Delete infomation. With unsortable JTable, add/edit/delete function is ok, but with sortable JTable, when i click on the header of one column, that … | |
i am doing a desktop application using netbean6.8 how to show error message if i didnt enter mobile number textbox pls help me.... | |
Hi everyone, how do i push item with a givin index in a linkedlist. e.g. linkedlist.add(element e, int index); this is my function [CODE]public void push(Student s, int index){ if(isEmpty()){ start = s; }else{ last.next = s; } last = s; size++; }[/CODE] | |
Hi! I would like to develop a software that will allow me to find a file (using JFileChooser) on a local machine and save it to a remote machine. I know an IP address of the remote machine. Please, give me some explanations or a link to some tutorials regarding … | |
I want to set up a connection to a Microsoft SQL Server 2005 express on my PC. [code=java] try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection( "jdbc:mysql://localhost/db1","xxxx","yyyy"); Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT nume FROM tabel1"); while (rs.next()) { String s = rs.getString("name"); textArea.append(s); } } // Catches any … | |
Is there anyway to play an mp3 file in java? P.S I'm new here, hello world? | |
The problem is that when we use multiple threads and each containing System.out.println(). It doesnt print at time according to what i think it shoud On implementing the below 2 codes: [CODE] import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.SocketException; import java.util.concurrent.LinkedBlockingQueue; import java.util.logging.Level; import java.util.logging.Logger; class E { LinkedBlockingQueue<DatagramPacket> li = … |
The End.