3,927 Posted Topics
Re: You are very close there: [ICODE]int[][] apostas = new int[n][7];[/ICODE] You want 'n' elements that each contain an array of 7 elements. Your outer loop [ICODE]for(int i=0;i<n;i++) [/ICODE] then denotes that first dimension, so[ICODE]aposta[i]=geraAposta(); [/ICODE] | |
Re: Just add a call to [ICODE]super.paint(g)[/ICODE] prior to your own paint code. [code=java] public void paint(Graphics g) { super.paint(g); g.drawString(output, 50, 50); }[/code] | |
Re: I'm not certain if I understand what you are trying to do exactly, but perhaps it is this: [url]http://faq.javaranch.com/java/BackgroundImageOnJPanel[/url] ? | |
Re: You could start with the Sun tutorial on networking: [url]http://java.sun.com/docs/books/tutorial/networking/index.html[/url] | |
| |
Re: I just quickly glanced through the code, so perhaps I missed something, but it looks like you've added a JMenuBar to a JPanel and added that to your JFrame. I would recommend using [URL="http://java.sun.com/javase/6/docs/api/javax/swing/JFrame.html#setJMenuBar(javax.swing.JMenuBar)"]setJMenuBar()[/URL] method on JFrame to add the menu to the frame. | |
Re: Is there any difference in those or did you post three copies of the exact same thing? | |
Re: And a [URL="http://java.sun.com/javase/6/docs/api/java/util/Map.html"]Map[/URL] could prove useful in aggregating the values after you have parsed them. | |
Re: I believe you should be able to cast the Node to an Element and use [URL="http://java.sun.com/javase/6/docs/api/org/w3c/dom/Element.html#getAttribute(java.lang.String)"]Element.getAttribute(java.lang.String)[/URL] (Just guessing though - we use JDOM here instead of that api) | |
Re: Stating why you are unable to execute that code might prove useful to someone inclined to offer advice on it. Your file names are just fine, but I would remove the package declaration from "Testing", unless you have re-created the directory structure of those files. | |
Re: [QUOTE=LouieAnn;846708][CODE]uhm can u give me advice about cs thesis?? [/CODE][/QUOTE] uhm... don't just skip it or you may fail? | |
Re: Netbeans does support PHP now and it does have a visual designer, but I have not used it for PHP and can't speak to it's strengths/limitations. | |
| |
Re: Just a couple of minor but important changes in your setGui() method[code] public void setGui() { JFrame frame = new JFrame(); // remove this, you want to use your current class instance here // JPanel drawP = new JPanel(); // again, current instance addMouseListener(this); // same here frame.getContentPane().add(BorderLayout.CENTER, [B]this[/B]); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); … | |
Re: Are you compiling against java 1.5 or later? Those declarations of Vector are perfectly valid post-1.5. You have other issues with using get(Object) calls that are not valid, but the declarations are fine. | |
Re: Why not mark it solved yourself? The link is right there at the bottom of the thread :) | |
Re: You could take a look at Web Start: [url]http://java.sun.com/docs/books/tutorial/deployment/webstart/index.html[/url] | |
Re: I believe he wants to redisplay the values that the user entered if the form fails validation and needs to be edited and resubmitted. | |
Re: And complaining that [I]volunteer[/I] help does not meet your personal expectations is rude as well. | |
Re: What you are wanting to do has absolutely nothing to do with a for() loop. You need a simple if() check on a counter variable that is incremented by your click event - something like [code]int clickCount=0; void mouseClicked(){ ++clickCount; if (clickCount > 0){ // do whatever } else { … | |
Re: You can create that menu bar as a reusable bean form by selecting the following: [icode]New > Swing GUI Forms > Bean Form[/icode] and specifying [ICODE]javax.swing.JMenuBar[/ICODE] as the super class in the final step of the wizard. After you have it built, you can add it to a JFrame by … | |
Re: [QUOTE=xkey;825830]such individuals logic is non-existent/faulty. An omnipotent being can manipulate the universe and adjust the laws and principles (of physics, of mathematics or even of existence itself) of that universe ... or to paraphrase "through God all things are possible"[/QUOTE]Ah, well at least there isn't anything wrong with [I]this[/I] logic. … | |
Re: Of course, it's a lot easier if you just have the index of your array/list be the power: [icode]4x^2+5x^3+6 --> [6, 0, 4, 5][/icode] | |
Re: Your error message should also indicate which method does not exist. Which one is it complaining about? | |
Re: Here's a skeletal recursion for it. You just need to figure out the depth part[code=java]public void listFiles(File dir){ for (File file : dir.listFiles()){ if (file.isDirectory()){ listFiles(file); } else { // whatever } } }[/code] | |
Re: You can use the [URL="http://www.herongyang.com/jdbc/JDBC-ODBC-MS-Access-Connection.html"]JDBC-ODBC Bridge driver to work with MS Access[/URL]. Here is the tutorial on using JDBC if you are not familiar with it: [url]http://java.sun.com/docs/books/tutorial/jdbc/index.html[/url] | |
Re: >can you list those as well? Why? If you are looking for a reference on a particular topic, ask about it. "hundreds of books on... (blah)" isn't useful to anyone at all, unless they really want to learn about the book purchasing habits of some random individual on the internet. | |
Re: You already have a constructor using Image and AudioClip, so what problems are you having with that? And you add code tags like this: [noparse][code] ... your code here ... [/code][/noparse]. | |
Re: [QUOTE=king_786;842585]thats wah i mean i dnt knw hw 2 start it[/QUOTE] Drop the lazy "chat speak". Read the forum rules regarding posting in proper English. This is about the fourth homework assignment that you have posted verbatim without showing any effort or even a thought on the matter. This is … | |
Re: It depends entirely on the layout manager you have set and how you add the JTabbedPane component. It will behave like any other container component in that context. [code]JTabbedPane tabPane = new JTabbedPane(); tabPane.add("Test 1",new JPanel()); tabPane.add("Test 2",new JPanel()); getContentPane().add(tabPane); pack();[/code]will create a tabbed pane that fills the frame. | |
Re: Movement through a circular structure such as a circular array, degrees of rotation, days of the week, etc. | |
Re: [ICODE]characters[i].isLowerCase()[/ICODE] is not valid for char - it's a primitive, not an object. | |
Re: You need to update the coordinates of existing circles if you wish for them to change size or position. I'd recommend taking all code that creates or changes the size out of the paintComponent() method. That should just render the circles you have created. Handle the adding of a new … | |
Re: Take a look at the end of line 14 where you have the while statement. See anything that perhaps should not be there? | |
Re: By 29 posts, you should understand how to use [noparse][code] [/code][/noparse] tags. As for the exception, make sure you have that jar file in your class path. | |
Re: >Is this the good technique (I mean in performance) to do all the drawing on some image and then draw that image at once to the screen Yes, that is typically what is done. You can update portions of the image as you wish and paintComponent() just renders that image … | |
Re: I hope you are not holding your breath as you wait, since homework help is generally only given to those who demonstrate some effort. These are not "code by request" forums. Post your code and state what problems you are having or ask specific questions about concepts you do not … | |
Re: And JOGL is available if you want to work with OpenGL instead of the Java3D scene graph model. | |
Re: Which language are you developing this panel in? Knowing that would greatly help :) | |
Re: Ok. I don't see any significant difference here from this thread: [url]http://www.daniweb.com/forums/thread185073.html[/url] so I'm going to shut this one down. I think there are too many replies in both threads to be able to merge them and have any semblance of continuity remain. rm_daniweb, in the future restrict conversation on … | |
Re: You need to demonstrate more effort on these questions that you are posting. Simply posting the assignment is not sufficient and no one is going to just complete these for you. Post what code you have. Ask specific questions about concepts you are struggling with. | |
Re: [code]Trash t = new Trash(); t=null; System.gc(); System.runFinalization(); [/code]does run the finalization. Finalize is a bit of a tricky thing and really shouldn't be relied upon as a cleanup mechanism. If you need to close resources, you should put explicit methods in for that and call them when required. You … | |
Re: Welcome to DaniWeb. Perhaps you can find useful marketing suggestions in our Internet Marketing forums. | |
Re: So you would just need to "group by" table and use another aggregate function to sum them up. I bet you can find that function pretty easily. | |
Re: Interfaces do not have any code themselves. They are a set of method declarations that are required by a class that implements that interface. The interface is a guarantee that those methods are available on any class that implements it. The code for those methods goes in the class that … | |
Re: This increment will work[code]t += (count%3==0 ? 0.3 : 0.1);[/code] but you'll have to figure out the loop to go around it. It's not a complex one. | |
Re: Welcome. You'll find plenty who share your passion here. | |
The End.