36,051 Topics

Member Avatar for
Member Avatar for Q8iEnG

Hi mates :) how are you? I hope everything is all-right.. ;) I have a small question, it is my HW to be honest here is the question: "Write a method that calculates the following equation: f(x) = 1 if x = 0,1 √ f(x-1) + √ f(x-2) if x …

Member Avatar for Q8iEnG
0
109
Member Avatar for daffer

Hi all I am new to Java and having trouble with constructors with images and audio. I have tried to use the API library to work it out myself but cannot understand what they are talking about. My problem is that I am trying to create two instances of the …

Member Avatar for javaAddict
0
128
Member Avatar for priyotosh

Hello everyone, i m designing a web site using jsp and i want to open any files like pdf . doc, etc in the browser without downloading it in the system, files are kept in the location(for eg .g://myfile.doc). please suggest a feasible solution.

Member Avatar for priyotosh
0
113
Member Avatar for king_786

i am stuk on this and have a[solutly no idea in how to create the while loop!!! could someone please show me how to do this??? Write a Java application that calculates the number of repayments for a loan based on the initial loan amount, annual interest rate and monthly …

Member Avatar for BestJewSinceJC
0
110
Member Avatar for Utter_iMADNESS

Hi. I'm working on a program that rolls 2 dice a number of times and displays the number of rolls per combination. It also displays this in a bar graph that shows the percentage of times that each combination got rolled. I've gotten to the point where it rolls the …

Member Avatar for BestJewSinceJC
0
176
Member Avatar for StevenJava

For one of my programing classes I have to design a maze game, that has a character moving in a maze against time. The question is how to make it so that this character, in this case a button, can not pass through the maze line. I have decided to …

Member Avatar for BestJewSinceJC
0
84
Member Avatar for king_786

Write a Java application that displays factorials for a user input specified number. The factorial of a number, n, is the product of all of the positive integer values between 1 and n, and denoted by the ! symbol. For example, the factorial of 5, 5!, is calculated by multiplying …

Member Avatar for tux4life
0
244
Member Avatar for BestJewSinceJC

I have a JTabbedPane inside a JFrame. I've been having a lot of problems with resizing and things like that. . how do I get the JTabbledPane to resize with the JFrame? So when the user drags the window open to a larger size, the JTabbedPane should be dragged to …

Member Avatar for BestJewSinceJC
0
202
Member Avatar for venugreddy

Hi All - I am using Hibernate Transactions in our project . The flow is as follows. JSP --> Actions -- > Business Layer --> Component Layer --> Persistence Layer --> Data base Currentl I am doing Transaction management in Persistence Layer. Can I do it in business layer ? …

Member Avatar for venugreddy
0
97
Member Avatar for cosi

I'm a RSS grubber that can't feed enough RSS into my RSS aggregator. If you don't know about RSS, RSS is a great way to get news/articles from multiple sources. Here is a link explaining RSS with many RSS programs you may use to view feeds: [url]http://reviews.cnet.com/4520-10088_7-5143656.html?tag=rss[/url] This comes especially …

Member Avatar for BestJewSinceJC
0
183
Member Avatar for testing321

how wud i create a code tht wud display letters of a string entered by user according to the number being odd or even? so say user enters sentence: i like ice cream. the even output : ilkiecem odd output: the rest of the letters (tht are at odd positions) …

Member Avatar for BestJewSinceJC
0
136
Member Avatar for abd640

Hi Guys, i really need your help. i have a nia ocz product(that use your brain signal and your muscle movement for performing some actions)... this product generate EEG signals(alpha and beta) and from it you can do some actions. it is used in gaming, and it is designed for …

Member Avatar for JamesCherrill
0
141
Member Avatar for spec80

Hi, I am trying to use recursion and count to find the number of times the number 5 appears in an array. I have the following code: [CODE]public static int countfive(double[] array1, int beginarray, int endarray,int count) { int next; if(beginarray==endarray) { if(array1[startIndex]==5) return 1; else return 0; } else …

Member Avatar for spec80
0
121
Member Avatar for rockin_rebel

Hi everyone I am having a lot of trouble trying to get the toUpperCase method working. I have basically put a String of text into a character array and I want to convert a certain character in a certain place in the String to uppercase. Here is what I have: …

Member Avatar for rockin_rebel
0
3K
Member Avatar for jacline

I wrote a code about circle starts to grow followed by finner circles, with each new one disappearing earlier while growing but in my code it is only growing how can I disappear the early one?? I didnt put the main method only classes [code] import java.util.ArrayList; import javax.swing.*; import …

Member Avatar for Ezzaral
0
176
Member Avatar for kid icarus

I had to implement a priority queue using binary heaps, which I think I have gotten completed, except for one method. We have implement a delete(Anytype X) method which deletes the object x from the priority queue. (It should return false if x is not in the priority queue, and …

0
74
Member Avatar for brizwhiz

My program compiles without any errors, however, when I go to run it all I get is a message saying "Welcome to the Payroll Program". From there it does not print anything else nor allows me to enter any information. If someone could please take a look at my program …

Member Avatar for BestJewSinceJC
0
1K
Member Avatar for abhi_elementx

Hi all. I am trying to connect to MySQL database on a remote m/c(IP: 192.168.120.44) Heres my code: [CODE] System.out.println("Making new connection(object).."); Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://192.168.120.44:3306/tox_erp10","root","tiger"); System.out.println("Done"); [/CODE] I am using netbeans IDE. [B]I can connect to the remote database thru SERVICES in netbeans[/B]. But the code doesnt work.. It …

0
78
Member Avatar for vict0rjr

/** * This method will ask the user for some information, create a blank picture to use as a palette and create and display the palette. */ 186 public static void main(String[] args) { 187 int redValue; 188 Scanner sc = new Scanner(System.in); 189 System.out.print("Enter a Red value: "); 190 …

Member Avatar for vict0rjr
0
142
Member Avatar for coolbuddy059

I've tried to make connection with oracle database using code: import java.io.*; import java.sql.*; public class dbcon{ public static void main(String[] args) { try{ String driver="oracle.jdbc.driver.OracleDriver"; Class.forName(driver); String jdbcURL="jdbc:oracle:thin:@127.0.0.1:1521:stud"; String username="scott"; String password="tiger"; Connection conn=DriverManager.getConnection(jdbcURL,username,password); System.out.println("***Connected to the database***"); conn.close(); }catch(ClassNotFoundException e){ System.out.println("could not find the database driver"); }catch(SQLException e){ …

Member Avatar for Ezzaral
0
97
Member Avatar for petike

Hi all, I am working on the "Pacman" game and I want to use the "double buffering" technique for animation. By now, I have used this code: [CODE=Java] class GamePanel extends JPanel { public void paint(Graphics g) { // Do some drawing here... } } [/CODE] and there was by …

Member Avatar for Ezzaral
0
274
Member Avatar for ganmo

Hi, I wonder if it's possible to check whether a MySQL DB has updated. e.g. new information is added to a table? and if it detect an update. it will perform search or something else. Main question is if it is possible to listen for changes in the db.

Member Avatar for masijade
0
113
Member Avatar for tomdegetel

Hi, I have a web application running on a servlet container(2.3). All the servlets inherit from one single servlet that inherit from HttpServlet and implements a service() method. The service() method of the main page provides authentication mechanism and also a protection against 2x clicks and refresh from user's browser. …

0
38
Member Avatar for abhi_elementx

hi all. I want to ch ange my jframe's icon(cup of coffee). i chkd the forum but that's what i m doing... here's my code: [CODE]public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { AppStarter dialog = new AppStarter(new javax.swing.JFrame(), true); dialog.setLocationRelativeTo(null); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public …

Member Avatar for abhi_elementx
0
194
Member Avatar for christiangirl

Hello, this code is throwing and IOException and FileNotFoundException and I am having trouble figuring out why. Where exactly does the song need to go in order for the program to pick it up? Also, is this code for putting the song in the program correct? Thanks! [code] //Hangman a …

Member Avatar for christiangirl
0
138
Member Avatar for maximilian2006

I couldwrite a customize JButton in java What I mean by a customize JButton is that I overridden some of it's methods, such as paintBorder, paintComponent. I could write a round,triangle or any other shaped JButton. I wonder how to write a different shaped JFrame, such as round or triangle …

Member Avatar for JamesCherrill
0
122
Member Avatar for abhi_elementx

Hello guys. I am doing a swing application wherein I m using a DefaultTableModel. Here's my code: [CODE] DefaultTableModel tab = new DefaultTableModel(){ @Override public boolean isCellEditable(int r, int c){ //if(c == 10) {return true;} return false; } }; private JTable jt = new JTable(tab); [/CODE] The JTable will diplay …

Member Avatar for abhi_elementx
0
112
Member Avatar for Upsilon

Hi guys, Just a question I think many people like myself would like to know the answer to. I have been using the Graphics2D class and it works great, however now I want to do some 3D things. I would like to know how to place ellipsoids in 3D space, …

Member Avatar for BestJewSinceJC
0
288
Member Avatar for VernonDozier

I am trying to learn GridBagLayout. I've gotten the hang of it in many respects, but I am having serious problems when the first row has element(s) with a gridwidth greater than 1 or the first column has elements(s) with a gridheight greater than 1. I'm trying to make a …

Member Avatar for VernonDozier
0
405
Member Avatar for ckillackey

Hey guys, I think I have this mostly figured out but i'm still getting some errors, I'm not sure if it's a syntax thing or if I called out a variable wrong. For some reason eclipse is saying that my variable [B]average[/B] "may not have locally been declared" which doesn't …

Member Avatar for ckillackey
0
297
Member Avatar for RaniThomas

Help me please... Can anyone tell me the link of sample J2EE Application(Downloadable) which involves JSP, Servlets, EJB, Java Classes.

Member Avatar for peter_budo
0
121
Member Avatar for ddaudi8

Hi there, I'm new to java. And I would like to get data that I have in a Ms Access database and sending to a excel spreadsheet using java. I've search the web and I keep finding the ohter way around. Could anyone provide me with a sample java code …

Member Avatar for JamesCherrill
0
125
Member Avatar for doha786

As a java beginnners what i incline to do for my program almost get solution from this site. Right now i need a small help to get file name or full path for output files of my program. so far my program is running as a search engine to find …

Member Avatar for doha786
0
116
Member Avatar for Mel1976

I am trying to get this finished, but it seems everything I do to fix it, I get even more errors. Please help me figure this out, I am having a lot of problems with this particular program. Below is my program and build errors, can someone let me know …

Member Avatar for BestJewSinceJC
0
109
Member Avatar for get2tk

Write a program which uses a for statement to simulate 120000 rolls of two dice. 'Keep track' of the number of times each possible outcome (a total in the range 2 to 12) is rolled using 11 integer variables. After all the rolls output a table showing the number of …

Member Avatar for BestJewSinceJC
0
91
Member Avatar for neutralfox

Hello everyone, Can someone please explain to me the meaning of the code below: [code] public class Client extends javax.swing.JFrame implements Runnable { // constructutor public Client( String host, int port ) { . . . new Thread( this ).start(); } public void run() { something.... } } [/code] This …

Member Avatar for JamesCherrill
0
123
Member Avatar for dhr

hey can any one help me?? i have 2 develop a code to find the "lowest and unique" number from a array..i thot of sorting them and then comparing the lowest number with othe numbers but i m feelin it wont work...pls help me out...

Member Avatar for BestJewSinceJC
0
825
Member Avatar for neutralfox

Hello everyone, I got a question on synchronization, hope someone will be able to give me a clear explanation. [code] public void sendToAll( String message ) { ..... synchronized( outputStreams ) { ... ""statement block"" } } [/code] outputStreams is an object here. I made some research and I found …

Member Avatar for neutralfox
0
102
Member Avatar for sivak

write the javascript code to hide a particular label in c# .net..can any one tel me?

Member Avatar for ddanbe
0
80
Member Avatar for mkadiri

Im stuck on my loop program, I have to create a loop program for arrays which only stops if a user inputs quit or the user has input 1000 entries, the program then has to sort the arrays in order of composer. I've tried so many different kinds of algorithms …

Member Avatar for mkadiri
0
123
Member Avatar for gabec94

I am trying to write a program that calculates the value of pi from the infinite series of pi = 4 - 4/3 + 4/5 - 4/7 + 4/9...etc. As you can tell, the numerator stays at 4, while the denominator goes up incrementally in odd numbers, if the program …

Member Avatar for gabec94
0
1K
Member Avatar for peter_budo

[B]This is not a question just small challenge[/B] if you interest in improving provided solution and feedback for me. I just went back to some assignment I did at university and one of these been design phone book for mobile device with use of Java Microedition (JME). At the time …

Member Avatar for peter_budo
0
335
Member Avatar for hkansal

Hello, Currectly I was doing an assignment where I was connecting to remote unix boxes from a windows system and some response from them. The response is something like [CODE] att1,att2,att3,att4\n val01,val02,val03,val04\n val11,val12,val13,val14\n ... ... [/CODE] This response comes to me as a long StringBuffer. Then I have to render …

Member Avatar for masijade
0
89
Member Avatar for Miyuki Suzuki

Good Morning all, I need some help with loading a file into a sybase IQ table with the "LOAD INTO" statement. I have never used it before and I cant seem to get myhead around how I am supposed to implement it in my java app. I have a stateless …

Member Avatar for Miyuki Suzuki
0
114
Member Avatar for jacline

a GUI application that presents a game based on a 4 by 4 matrix of buttons.One of the buttons (selected at random) "hides" the prize. A status bar at the top of the window shows the number of guesses. When the prize button is pressed, the status bar shows "You …

Member Avatar for jacline
0
807
Member Avatar for ivatanako

[code]import java.io.*; public class getLowestValue { public static void main(String[]args) throws Exception { DataInputStream input=new DataInputStream(System.in); System.out.println("Get lowest value "); int a[]=new int[10]; int x =0, i=0, j=0, tmp=0; // display and get inputs [5] for (x=0;x<5;x++){ System.out.print(x+" Enter a number: "); a[x] = Integer.parseInt(input.readLine()); } // sorting for (x=0;x<5;x++){ …

Member Avatar for jasimp
0
213
Member Avatar for syuk

DEAR JAVA EXPERTS. can u help me? i dont know how to do the next move.... i want to write code that can make each object of the class Book can hold the following information about a book: title, up to four authors, publisher, ISBN, price, and number of copies …

Member Avatar for BestJewSinceJC
0
218
Member Avatar for tharsrini

how to implement the secure file encryption and decryption using jsp for web application? can i use RSA or DES encryption algorithm? plz somebody post me? it's urgent

Member Avatar for amarender1201
0
139
Member Avatar for jacline

Design and implement a simple GUI application (or applet) that displays the graph of a quadratic function, Ax2 + Bx. Below the plot should be two sliders which allow the user to interactively set the values of A & B, the display being updated continuously in response to any changes …

Member Avatar for jacline
0
130
Member Avatar for doha786

i am very new in java. in GUI class i have code like this : [CODE] public void actionPerformed(ActionEvent e) { if(e.getSource()==listButton){ ArrayList<String> list = new ArrayList<String>(); list.add("Orange"); list.add("Apple"); list.add("Pineapple"); list.add("Lemon"); list.add("Pear"); for(int i=0; i < list.size(); i++) { String s = list.get(i); { textArea.setText(s+"\n"); } }[/CODE] but its showing …

Member Avatar for javaAddict
0
110

The End.