32,199 Topics

Member Avatar for
Member Avatar for vomhaus

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 …

Member Avatar for NormR1
0
159
Member Avatar for LaLuz

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

0
119
Member Avatar for Johan Schmidt

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

Member Avatar for Ramesh S
0
113
Member Avatar for bangor_boy

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 …

Member Avatar for stevanity
0
245
Member Avatar for marsangel

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 …

Member Avatar for mKorbel
0
287
Member Avatar for syeda amna

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.

Member Avatar for syeda amna
0
203
Member Avatar for Majestics

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 …

Member Avatar for Majestics
0
152
Member Avatar for hwalsh

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

Member Avatar for FALL3N
0
354
Member Avatar for Zephnath

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

Member Avatar for NormR1
0
2K
Member Avatar for dannny_00

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 …

Member Avatar for jon.kiparsky
0
131
Member Avatar for trivax

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

Member Avatar for Ezzaral
0
894
Member Avatar for Vern247

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

Member Avatar for Vern247
0
165
Member Avatar for AhmedGhazey

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 …

Member Avatar for NormR1
0
147
Member Avatar for winecoding

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 …

Member Avatar for JamesCherrill
0
175
Member Avatar for Choucas35

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 …

Member Avatar for JamesCherrill
0
130
Member Avatar for khaled_jawaher

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 …

0
64
Member Avatar for bhagawatshinde

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 …

Member Avatar for bhagawatshinde
0
614
Member Avatar for katharnakh

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 …

Member Avatar for naveenreddygine
0
162
Member Avatar for Bhargo

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????

Member Avatar for Bhargo
0
41
Member Avatar for MooGeek

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!

0
67
Member Avatar for larrymtl

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

Member Avatar for larrymtl
0
238
Member Avatar for steve_Student

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 …

Member Avatar for NormR1
0
288
Member Avatar for steve_Student

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 …

Member Avatar for Ezzaral
0
307
Member Avatar for babbu

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

Member Avatar for peter_budo
0
108
Member Avatar for olsane

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 …

Member Avatar for NormR1
0
89
Member Avatar for coding101

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 …

Member Avatar for NormR1
0
127
Member Avatar for winecoding

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

Member Avatar for mKorbel
0
156
Member Avatar for bufospro

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 …

Member Avatar for mKorbel
0
98
Member Avatar for AnkitKumar

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 …

Member Avatar for JamesCherrill
0
118
Member Avatar for MooGeek

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 …

0
62

The End.