- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 7
- Posts with Upvotes
- 6
- Upvoting Members
- 5
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
36 Posted Topics
Re: [QUOTE=MosaicFuneral;831213]Pink Floyd - Childhood's End, 7th March 1973 bootleg About a two and a half-hours long, and superb quality for an early '70s live recording.[/QUOTE] listening to dark side of the moon right now... | |
Re: my guess is O(x+x^3). cos if n tends to a huge number, the 3 nested for loops will likely take x^3 for the operation of x=x+5. and for the single for loop for y=y+1, thats adds the linear complexity.. EDIT- my bad, i didnt see the *3 for the first … | |
this is inside my servlet: [CODE]ArrayList<String> currentCustomer = model.getAllCustomers(); req.setAttribute("currentCustomer", currentCustomer );[/CODE] how do i access this arraylist in my JSP file? I eventually wanna loop over each string element. | |
Re: plus the language depends on what you want to do with the project e.g. if speed is an issue, use c, etc. if safety is an issue, use java, etc. | |
Re: if(you are serious about this qn) ------initialise a double array, iterate thru each element in a for loop, and 1.3X ------the value of each element; ------read the array API; else ------wtf; ------System.exit(0); | |
Re: cos the add method of the vector only accepts objects. therefore, primitive values like ints will not be accepted. only Integer objects will be accepted. refer api: [url]http://download.oracle.com/javase/1.4.2/docs/api/java/util/Vector.html[/url] | |
Re: what you are talking about can be done using the model view controller paradigm in java ee.. it uses a combination of servlets (controller)/JSP (view)/javabeans (model) to execute java code on a website. so your the first step is to go to netbeans and start a web project. you will … | |
Re: there are a number of errrors here: 1. its [CODE]import javax.swing.JApplet;[/CODE] NOT [CODE]import java.swing.JApplet;[/CODE]. 2. theres a missing ; after your drawString 3. your HTML file shouldnt have the <JApplet> tag. Use <applet> instead. And remember to open and close your tags. 4. when closing tags, it shouldnt be <\HTML> … | |
Re: accept user input using Scanner and System.in or perhaps a GUI, then use that number to initialise a 2D array (im assuming u need a n by n array). e.g. int [] [] arr = new int [n] [n]; | |
![]() | Re: depends on what you want to do. if u need speed, id suggest c or c++. if u want safety, java is a good bet.. umm, ive heard python is easy to start off with.. if ur nuts, learn haskell! ![]() |
Re: what an odd question.. obviously you're not printing anything to the screen so you shouldnt observe any output.. | |
Re: put some widgets into a JFrame, add action listeners, when u click, an action event will be generated which will be handled by the actionPerformed method where u can do what u want. but since you asked such a silly question w/o googling up first, i dont think this answer … | |
Re: [QUOTE]For each char c in [charAt(0)..charAt(s.length()-1)] check that it's in the range [a-z] or [A-Z]. Or, if you want a more permissive test, check that it's not in the range [0-9] - that will allow everything but the digits.[/QUOTE] yes, u shd do that. btw, you would probably need to … | |
Re: why dont you use switch/case statements? for the default case, accept a new input. cos your programming style is very messy.. anyway, ur program keeps looping cos your in.next() is inside the else if loop. bring it outside.. | |
Re: your event dispatch thread should be independent of your swing worker thread. the event dispatch loads the GUI while the swingworker does the intensive resource loading. for an example implementation, refer : [URL="http://download.oracle.com/javase/tutorial/uiswing/components/icon.html"]http://download.oracle.com/javase/tutorial/uiswing/components/icon.html[/URL] look for the picture tumbnail displayer example. btw in that example, the event dispatch happens on the … | |
Re: take the GUI input in the actionPerformed method. create an object of your other class and pass the GUI input value as a parameter to the objects constructor. | |
Re: methods are operations. for example, say you have a car. what operation would you want to perform on a car? e.g. drive, refuel, checkMileage, brake, etc. basically thats it. you use methods on objects. in this case, car would be the class, and perhaps Lambhorgini Murciealago would be the object, … | |
| |
Hi there friendly people of daniweb. My problem is that when i double click an executable jar file, nothing happens. Even when i use command prompt and type java -jar "filenae" it doesnt work. Any ideas why? | |
Re: from your GUI class, you can instantiate objects in its actionPerformed method. then simply call the methods on those objects (of your other program). you might then have to add the program results to the GUI. if you check javas API, there are numerous ways to add things to the … | |
Re: try ArrayLists.. | |
Re: perhaps you could use arraylists instead of arrays to provide some flexibility.. other than that im not entirely sure how to improve your solution till i can see some code.. | |
Re: before that, ask yourself- what is google and what is it used for. | |
Re: make a new JTextArea object. put it in a JFrame. addActionListener to this JTextArea object. take the input from the JTextArea (check Java API for JTextArea for the relevant method) and put it in a file. simple.. ummm, you do know how to append text to a file dont you? | |
| |
Re: put all your cast values in an array. then make another method called compare(), which takes adjacent 2 elements of this array and if both are equal, returns 1 and 0 if both are unequal. put these 19 comparison values (of 1s and 0s) in a new array of ints. … | |
Re: lol, ive actually written a simple parser for my Haskell assignment.. haskell tends to be quite abstract actually, and is not for everyone.. its gonna be tough making a fully fledged parser and interpreter.. | |
| |
Re: wrap your code with try/catch blocks in your actionPerformed method. that way, if a user enters something incorrect, it will be caught by the catch.. | |
hey guys, just one question- how do i get netbeans to import a whole folder (containing numerous java files)? the only option i currently get is to import eclipse projects. | |
Re: this code makes no sense whatsoever- 1. what is a perfect integer? 2. n is not initialised. so it becomes 0, and the for loop will never be entered. 3. a=o, it should be a=0. | |
Re: 1. You can have your class implement ActionListener. 2. Register a button (for example) with addActionListener method. 3. In your actionPerformed method, define the other GUI. e.g code [CODE]import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.io.File; import java.util.*; public class DemoJFileChooser extends JPanel implements ActionListener { JButton go; JFileChooser chooser; … | |
Re: mutual exclusion is best exemplified by the readers and writers problem (this is a standard textbook scenario taught in universities). if ur dealing with mutex, you have to know this first. [url]http://en.wikipedia.org/wiki/Readers-writers_problem[/url] | |
Re: make an AI controller for mario. i mean, cmon who doesnt like mario? i think youll probably have to evolve neural nets for this using Evolutionary Algorithms. [url]http://www.marioai.org/[/url] | |
Re: you need a main method, not a main class. this main method could either be in your Bankaccount class which you displayed or in another class (which creates a Bankaccount object). |
The End.