32,199 Topics
| |
I need to read a .txt file into a list and then pass one element of the list to a method and return to the main loop, run through the loop again and pass in the next element... Thanks [code] File file = new File("pathToFile.txt"); List<String> contents = FileUtils.readLines(file); do … | |
Hi, I'm having a problem getting the auto generated ID immediately upon commit. I have an entityBean mapping like this: [CODE] @GeneratedValue(strategy=GenerationType.AUTO, generator="SEQ_SETTLEMENT_TRANS") @SequenceGenerator(sequenceName="SEQ_SETTLEMENT_TRANS", name="SEQ_SETTLEMENT_TRANS") @Id @Column(name="SET_TRANS_ID") private long setTransId; [/CODE] and I am trying to get the Id like this: [CODE]setEntityManager(PersistenceManager.getEntityManager()); getEntityManager().getTransaction().begin(); getEntityManager().persist(settlementTrans); getEntityManager().flush(); getEntityManager().getTransaction().commit(); System.out.println("ID :: "+settlementTrans.getSetTransId()); [/CODE] … | |
Hello, We have created a DLL in VisualStudio 2005 and installed it in Global Assembly Cache (GAC) through MSI to use in Internet Explorer as a plug-in. This DLL is working fine in Windows XP and Windows 2003 Server OS. For Windows7 OS, if we run IE8 as an administrator, … | |
Learning about Abstract classes and interfaces, is there anything else I have forgotten about? [B]Abstract Class[/B] 1.Cannot be initated. 2.Can have concrete methods. 3.Abstract methods with no body 4.A class extending the abstract class does not need to use all the abstract methods from the abstract class. 5.A class can … | |
So I need to make a table where all the records in my ACCESS database will reflect. The table should be editable. the table should have the basic functionalities such as ADD, EDIT and DELETE. I also need to make a search where a user can type what he/she wants … | |
hi i am working on servlet using eclipse IDE .i have attached html form. I am unable to format drop down list. how to do it. how to align the drop down list.please help. | |
I have made a single combo box and added it with table... Items are added from database. There are three combo box A , B AND C ... B depend on A And C on B. Now if i select anything from row one A combo box it will load … | |
I'm having an issue that I've been working on most of the day. I want to get the user name, then return it twice, but can't seem to get the variable right. Here is my code. [CODE]import java.util.Random; import java.util.ArrayList; import java.util.Scanner; public class mlab { // instance variables - … | |
[I]Hello all, I am looking for some help writing an application with the following attribuutes: An online retailer sells five products whose retail prices are as follows: 1. Product 1, $2.98 2. Product 2, $4.50 3. Product 3, $3.98 4. Product 4, $4.49 5. Product 5, $6.87 Write an application … | |
So I have a program scenario for a postman who carries out an experiment: 1. He has mailboxes numbered 1-150 all of which are 'closed' 2. Starting with mailbox 2, he 'opens' all even-numbered mailboxes, leaving all others 'closed' 3. Next, beginning with mailbox 3,goes on to 'open' every third … | |
i m using gettext() method in getting text from the form and pass it to the sql query to record in the mysql database. when i don't enter any string for textfield (for eg: phone no.) , i get sql exception error.. here is my sql query in the code.. … | |
The following code is for a standalone applet that calculates a shipping rate based on a selected shipping method. Normally, the program would read the total price of purchases from the website but for the sake of this exercise, the user will enter the price on the applet. [CODE=java]import java.awt.*; … | |
Hello , I ask if any one can help me , by suggest tutorial . I need make java app GUI which take String from user , and write this String in web page text field . for example : username and password , when both are written on the … | |
My program includes a code segment as following: [CODE]for (int j1 =0; j1<2;j1++) { for (int j2 =0; j2<2;j2++) { System.out.println("j1="+j1+"j2="+j2+" "+temp1.get(j1)+"----"+temp2.get(j2)); if (temp1.get(j1)==temp2.get(j2)) { System.out.println("find match"); } } }[/CODE] The program prints out sth like j1=0j2=0 7698380----7698380 the difference is 0 j1=0j2=1 7698380----7726365 the difference is -27985 j1=1j2=0 7726365----7698380 … | |
Same problem but with a file !! I have a file on a web site read by an applet. This file is now "corrupted". The applet can't read, the editor of this fiel can't read ! I use serialversionids for my own classes but I don't subclass all the classes … | |
i want to know if is it possible for a client to consume a gui object like JFrame ot JTable by using jax-ws web service.for example for a server web method to return a JFrame so as for client to consume this method??? i've searched a lot.i want a useful … | |
Hi all, I am generating a html report displaying the records. In that report their are 10 rows and 4 columns. In 4th column i am adding the button. Now i want to use button click event i.e onclick() . 1) how i call the javascript function/Javascript. 2) how can … | |
hi, why explicit cast is *not* required here? [icode]static Float f3 = new Float(5.5); //causes compile-time error b'se, by default floating-point literal type is double[/icode] but requires here, [icode]//static Short sh1 = new Short((short)12); static Short sh1 = new Short(12); //causes compile-time error b'se, by default integer literal type is … | |
hi, I am trying to start a new cmd from a java program.... I have been able to do it successfullt but I alse want to write to that new cmd from that very java program.. is it posible???? | |
Hi, I need to put Icons on a SWT Tree. is it by using setImage? But I don't know how to use it... please help me. thanks! | |
Hello guys, please could somebody help me...there is a problem with logic in my loop with pretty the same structure in methods: [B]public void isMember()[/B] and [B]public void deleteMember()[/B] Compilator ignores the scanner and directly goes to else statement and puts it in the loop 10 times... [CODE] import java.util.*; … | |
Hi I am a student needing help with my assignment. My assignment is a loan calculator that takes in a customer’s details such as name, address, occupation and the amount they wish to borrow. My assignment says the base interest rate is 9.7%, however: if the amount a customer enters … | |
Hello, iam a student who is currently studying for an FD in IT, I need a bit of help with my java assignment and as it is a mortgage calculator i am developing, maths is not my strongest subject I have been trying to find out how to take in … | |
Hi, I have a code that writes data to excel using setcontentype(application/vnd.ms-excel) Now I want one of the columns to be formatted to currency. I do not intend to use any additional jars(POI, etc). Is it possible to achieve the task. Thanks | |
hey i have a little problem, how do i make this two triangle: O O O O O O O O O O O O O O O O O O O O i have to get input from user, that part i have done. but the problem is loops … | |
Hello, so my question is this..lets say you have a file like this. Computer Science 01 //course number 30 //number of students that can enroll 4 //number of students currently enrolled Math 02 //course number 20 //number of students that can enroll 12 //number of students currently enrolled And i … | |
I have a string, which is read from a database. The string can be just "null". I need to decide whether it is null or not? Among the following ones, what is the appropriate way to do it? [CODE]String a = …; If (a == null) If ( a.length == … | |
Hi, I am trying to make a timer applet when I click stop button to stop counting, disappear stop and appears continue button and when I click continue to continue the counting. My code is : [CODE] import java.applet.*; import java.awt.*; import javax.swing.*; public class Timer extends Applet implements Runnable … | |
class Foo { public static void classMethod() { System.out.println("classMethod() in Foo"); } public void instanceMethod() { System.out.println("instanceMethod() in Foo"); } } class Bar extends Foo { public static void classMethod() { System.out.println("classMethod() in Bar"); } public void instanceMethod() { System.out.println("instanceMethod() in Bar"); } } class Test { public static void … | |
Hi, I'm currently studying SWT Tree examples but I want it to be dynamic. since the data will come from a Database, I'd like to know how to do it? how to Insert new Leafs in a Tree? Please, make the EASIEST (DUMMY EXAMPLES). I'm really new here. if you … |
The End.