- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
24 Posted Topics
Hello. I'm trying to add a single test record (a comment item) to my MySQL database. So here are my sources of JSF2 project. - main xhtml page: [code]<h:body> <h:panelGroup id="mainBlock" layout="block"> <h:panelGroup id="header" layout="block"> <h:graphicImage value="resources/logo.jpg" style=""/> </h:panelGroup><br/> <h:panelGroup id="menu" layout="block"> <h:panelGrid columns="1" style=""> <h:outputLabel value="MENU" style=""/> <br/> <h:form> … | |
Hello. I'm trying to add a single test record (a comment item) to my MySQL database. So here are my sources of JSF2 project. - main xhtml page: [code]<h:body> <h:panelGroup id="mainBlock" layout="block"> <h:panelGroup id="header" layout="block"> <h:graphicImage value="resources/logo.jpg" style=""/> </h:panelGroup><br/> <h:panelGroup id="menu" layout="block"> <h:panelGrid columns="1" style=""> <h:outputLabel value="MENU" style=""/> <br/> <h:form> … | |
Hello! Here's the problem: After making some GUI application (NetBeans) in output directory (containing generated .jar file) also appeared a directory 'lib' with additional .jar. This jar is some extra library with classes, which path is added in manifest ("Class-Path: lib/bla.jar"). So I've used to pack my applications always intto … | |
Hello. I'm trying to write an application, which after pressing a key does a particular action. The thing is I need the application to receive key events even if JFrame isn't itself focused (is iconified). I've read somewhere that it cannot be done - is that true? If it is … | |
Re: I believe, that during those 3 years he managed to add those buttons... But I see You are making sure that he did. | |
Re: Use JTextArea methods append(String str) or setText(String str). Nothing big. | |
Re: I understand You have a problem with menu to Your program, where You can choose a number and something happens. You can use for this task BufferedReader class, which initialization look like that: [code=Java]BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );[/code] For reading a number from user is … | |
Re: Check if 'r' or 'dos' isn't a null also. | |
Re: [code=Java]public IntNode createList(int n) { while(head== null){ head = new IntNode(n, head); } head.addNodeAfter(n); // <------ return head; }[/code] In marked line after You created a head, You create head again and add it as link to head... Delete this line and should be fine. Also instead of loop here, … | |
Hello. I've got simple JFrame and into that I put JPanel (object of subclass of JPanel class). I want to check, what's this panel's size from inside of this panel class, but every method (getSize, getBounds) returns [0,0]. If I call getSize method from JFrame class, then it's fine, but … | |
Re: [QUOTE=ramborambo;866974]int[] values = new int[10]; values[ 10 ] = 0;[/QUOTE] Huge amount of code so far ^_^. IndexOutOfBoundsException You get here. Remember that, then int You pass in constructor is the number of elements, not the maximum index You can put element on. Remember that: new int[ length ] => … | |
Re: [code=java]import java.awt.event.* import javax.swing.*;[/code] 1. No semicolon on the end of 1st import. 2. You add imports only on the top of document, not in the middle. In the middle are 'class', interfaces or enum expected'. PS. [url]http://www.daniweb.com/forums/announcement9-3.html[/url] | |
Re: 2 things about that part: [code=java] if(e.isControlDown() && e.getKeyCode() == 10){ String strBefore = txtArea.getText(); txtArea.setText(strBefore+"\n");[/code] [b]1.[/b] Using Ascii numbers to check if key is pressed is not a nice way to check it - makes it unreadable without ascii char table in front of Your eyes. Instead use KeyEvent's … | |
Re: [url]http://www.jarticles.com/package/package_eng.html[/url] | |
Re: Hm, I can't see anywhere a method writeOutput, which takes those 3 arguments... But if You say that first argument should be passed as a Person object, then You have to create an instance of Person class and then pass it through Your method: [code=Java]Person nick = new Person("Nick"); honda.writeOutput( … | |
Hello. I've got such example statement: [code=Java]for( int i=0; i <= 10000; i++ ) myTextArea.setText( myTextArea.getText()+ i + "\n");[/code] What is the problem? I can't figure it out, why in every iteration of loop the text area isn't refreshing with new String added. When this loop is iterating, app freezes … | |
Re: Write on paper a set like a { 3,7,-1,5 } and make Your for loop on that. Notice, that iterating only 1 time on whole set is not enough. Most primitive version of bubble sort is making such iteration n-times. (where n is the number of elements) | |
Re: Using comparison [code=Java]string1 > string2[/code] is illegal in Java. To compare Strings You use compareTo method of String class: [code=Java]string1.compareTo( string2 ) > 0[/code] what would be in illegal way: [code=Java]string1 > string2[/code] | |
Re: Instead of using 2 arrays of Point objects, I suggest ArrayList<Line2D> class, so deleting particular line won't leave a 'hole' in array. Initialization of object Lin2D's class looks like that: [code=Java]Line2D line = new Line2D.Double( arguments );[/code] You paint it in 'paint' method ( or paintComponent? ) by: [code=Java]Graphics2D g2d … | |
Re: Well, I think that: [code=Java]@Override public String toString() { if( power ) return "Power: On"; else return "Power: Off"; }[/code] EDIT: Oh, I'm too late. :) | |
Hello! I'm searching and searching and can't find a solution... In my project I've got a folder 'Images' where from my application loads icons etc. Running project from IDE (NetBeans) it's of course working fine, but I want to create stand-alone application, so I create .jar file. And here's a … | |
Re: What You are asking is written above: [code]//using a for loop, check if the number has been used before //if it has been used before, do nothing //if it has not been used before, put it in array[number_filled] and increment number_filled by one. (Add one to it)[/code] In Java language: … | |
Re: For first: why do You call Collections.binarySearch(...), when You already iterate through Your dvd store? If You encounter dvd, that's title equals to searched title, You already have its index ( -> i ), so binarySearch is not needed here. For second: You'll get "Not found Dvd Object" message every … | |
Re: It's because You didn't create an instance of Your 'choices' variable. You need to allocate a memory by adding a line (in constructor i.e.): [code]choices = new Vector<String>();[/code] Oh, and I think You don't have to catch 3 times still one type of exception one after another. Remove 2 of … |