3,927 Posted Topics
Re: >Also, any suggestions about platform independent solutions? Java + Open Office | |
Re: [QUOTE=Tarli14;1167725]Output: Enter name: Ferrial P. Esber A - 1 B - 1 E - 2 F - 1 I - 1 L - 1 P - 1 R - 3 S - 1 Space - 2 Please reply ASAP, thank you very much[/QUOTE] I can. It's easy. One day you … | |
Re: So start working on it and start a new thread when you have an actual question to ask. No one is going to do it for you. | |
Re: Looks like they pushed 3.6.2 a bit early. I got an update alert today for it. | |
Re: You can use [URL="http://java.sun.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)"]String.split()[/URL] with an appropriate expression to turn that into a String[] array. | |
Re: [QUOTE=charpays;1166738]How can I do this? FILEOUTPUTSTREAM and FILEINPUTSTREAM provide code that will write bytes to file and read them back[/QUOTE] With a text editor, of course. | |
Re: Hmm.... nope. Try again. Show some effort or at least ask a specific question. | |
Re: Work for hire topics belong in the Looking To Hire section of the Business Exchange and are not allowed in the technical forums. If the OP wishes to ask technical questions related to completing his project, he can make a new thread for those. Closing this thread. | |
Re: Do not hijack and bump old threads to add your question. Create a new thread for this. Read the forum rules. | |
Re: Homework or self-study, it comes down to the same thing - if someone can't show that they have put any effort in solving the problem then they shouldn't expect someone here to just hand them a solution. | |
Re: Getting it to a state that it would even compile would help. You have all of your type declarations mangled up. Did you write any of this code to begin with? If I were to guess, you're in the process of trying to rename variables and modify someone else's code … | |
Re: Yeah, JButton doesn't show a background change too well on several Look And Feels, you could use a JLabel just fine though. Make sure to [iCODE]setOpaque(true)[/iCODE] so the background color is shown. For the timing, you might get by with a simple Swing Timer that sets each color after a … | |
Re: If your base class has an [iCODE]executeCode()[/iCODE] method, then you should be able to call that just fine in your handler. Your subclasses can override it however they wish. Example:[CODE] import java.awt.Dimension; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JLabel; import javax.swing.JOptionPane; public class ClickSubclass extends javax.swing.JFrame { public ClickSubclass() { initComponents(); … | |
Re: JLabels would work as well. I agree with BJSC, it would be a lot easier to draw an image one time in an editor for each symbol than to render them from primitive ops with Graphics2D. | |
Re: You could: a) add a 'parent' reference to the InfoObject so that when it's clicked it can set a property such as 'selectedInfo' on the parent to itself. b) Simply loop the list and find the 'selected' object. It really depends on the dependencies you're trying to support in your … | |
Re: You'll also face problems importing those classes if they were compiled into packages and you have unpacked them into a different directory structure. edit: Just to elaborate a bit, in the example BJSC posted above, the compiler would expect "OtherClass" to be found in a directory named "other". | |
Re: Bleh, I clicked the wrong box on the post above. Should have been a +1 :) | |
Re: You still have to render that [iCODE]doubleBufferImage[/iCODE] to your component graphics context in your [iCODE]paintComponent(Graphics)[/iCODE] method. | |
Re: [QUOTE=ankit606@gmail.;1158133]just buy a black book[/QUOTE] Thanks for that absolutely useless comment to dredge up this old thread, Ankit. I'm sure everyone appreciates your contribution. | |
Re: [QUOTE=RaineAlcyone;1151963]Hi everyone....can you give me a complete design of a library system?[/QUOTE] Nope. And I think this thread's done. | |
Re: [QUOTE=printrobin;1159253]I am unable to create it till now. please help me.[/QUOTE] What? You probably need to rephrase the question in a new thread. This doesn't make sense as it's written. | |
Re: Have you searched the forums for "final year project"? | |
Re: That would probably depend on what programming language you are using... | |
Re: You know, you could get by using just one exclamation point or question mark instead of 3-10 each time. Typing in caps doesn't help your case either - it just irritates people. ![]() | |
Re: [QUOTE=ssaurabh;657599]have u made the project? plz send me one for i m in urgent need.[/QUOTE] You are in urgent need of learning to do your own work. This forum is not for completing your homework for you. | |
Re: Put some debugging println statements in relevant methods like paintComponent(), draw(), etc. (I assume you aren't using an IDE with a debugger) so you can see what is going on internally. I glanced through the code and not jumped right out as a problem, but you didn't post the MyShape … | |
Re: You can easily extend [URL="http://java.sun.com/javase/7/docs/api/javax/swing/AbstractListModel.html"]AbstractListModel[/URL] to be a tiny wrapper around an ArrayList that's passed to it. | |
Re: The problem is that you are executing all of that code on the event dispatch queue - which also handles repaints - so it can't update the GUI until your current code completes. You need to start a separate thread to for the calcs and then update the UI on … | |
Re: Try executing it with [iCODE]java -jar BlueHarvest.jar[/iCODE]. If it still fails you probably need to fix up the manifest to specify the main-class attribute. | |
Re: You haven't defined a constructor for the Employee class that takes two strings, which is what your Manager class is trying to call. You need to define that constructor. | |
Re: Well, the tooltip for the down-vote arrow merely says "This post is unclear", so the down-voters may have simply thought it was a poorly structured question or that he should have been more specific about what he was having trouble with. | |
Re: Well, you probably don't want to get into the more esoteric algorithms for finding primes, but there are a few simple modifications that will reduce the number of checks you have to make. If [inlinecode]p%2==0[/inlinecode], it's prime. If that is not the case, you can start the loop at 3 … | |
Re: Is there a reason that your other thread on this wasn't sufficient? [url]http://www.daniweb.com/forums/thread264550.html[/url] | |
Re: If they really want to upgrade your skills, they should give you some real work to do, rather than dumping you into more classes to learn more technologies that you will only barely have a grasp on. | |
Re: And now you can see why blocks are indented. Each nested level should be indented from its parent. Format the code and you'll probably find the problem much easier when you can see the logical hierarchy. | |
Re: SimpleDateFormat can be used if you want to parse a Date from a String: [url]http://www.exampledepot.com/egs/java.text/FormatDateDef.html[/url] If you want to set a date programmatically, use a Calendar: [url]http://www.exampledepot.com/egs/java.util/GetDateFromCalendar.html[/url] | |
Re: If you have further HTML/CSS questions to work through, I'd recommend starting a new thread over in [URL="http://www.daniweb.com/forums/forum143.html"]that forum[/URL]. This one is getting rather long and covering multiple questions. Limiting threads to one topic and making sure they're in the correct forum makes it easier for both the helpers and … | |
Re: Seems like a reasonable comment to me. I would also add: ask a question or describe the problem. Don't just dump the code and say "fix this". | |
Re: And what is your question? Where's your code? Surely you don't expect someone here to write this for you. [url]http://www.daniweb.com/forums/announcement9-2.html[/url] | |
Re: This line[CODE]poly3.addPoly(poly1,poly2);[/CODE]will return the result of adding the two parameters - but you aren't storing that result in anything. To use the result you would use the function like so[CODE]Polynomial result = Polynomial.addPoly(poly1,poly2);[/CODE]and you would then want to print that result. (Note the different syntax for calling a static method. … | |
Re: Ok, here's something to play with[code]import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.Timer; public class LinePanel extends JPanel { Timer animationTimer; float angle = 0f; int lineLen = 60; int x = 20; int y = 20; int moveX = … | |
Re: I'd recommend re-thinking your painting logic altogether. You really don't want to be creating new components, adding them to your current container, and then trying to hand their graphics context off to be drawn on all inside the method that is just supposed to be drawing your panel. It's just … | |
Re: On line 45[code]fieldJPanel.add (fieldJPanel1,BorderLayout.NORTH);[/code]you haven't initialized 'fieldJPanel1'. Looks like you mis-typed it up above and set up 'fieldJPanel' twice. | |
Re: No, not as a language feature. Many editors have tags for collapsing section of code though. | |
Re: You may want to take a look at these: [url]http://java.sun.com/developer/technicalArticles/J2SE/concurrency/[/url] [url]http://java.sun.com/developer/JDCTechTips/2005/tt0216.html#1[/url] | |
Re: Perhaps [URL="http://java.sun.com/javase/6/docs/api/javax/swing/SwingUtilities.html#getDeepestComponentAt(java.awt.Component,%20int,%20int)"]SwingUtilities.getDeepestComponentAt(java.awt.Component, int, int)[/URL] ? | |
Re: Consider the following for your KochComponent. All calculations are done outside of the paintComponent method (you don't need to override paint() at all). For each iteration, you need to add three intermediate points to each line segment to form the triangle portion.[code=java]public class KochComponent extends JComponent { List<Point> points = … | |
Re: You could start with the [URL="http://java.sun.com/docs/books/tutorial/2d/index.html"]2D Graphics[/URL] tutorial. |
The End.