7,116 Posted Topics
| |
Re: When exactly do you want to do that formatting? As the user types - when he exits the field - when he clicks OK? What if he exits the field, you re-format it, then he goes back to that field - will you re-instate the input as he typed it … | |
Re: Hi hrbswat Welcome to DaniWeb. Your contiributions will be warmly received, but please take a moment to check the dates on threads - thos one was solved (and marked as such) two years ago, so its unlikely that anyone is still waiting to have the answer repeated! Please also respect … | |
Re: Mixing Swing and AWT like that is always risky. Maybe try using a JPanel instead of a Canvas? YOu may also find some useful info on which methods to call and which to use with Swing [here](http://www.oracle.com/technetwork/java/painting-140037.html#swing). If you use just Swing conponents you have double-buffering as standard, which may … | |
Re: MouseListener has methods for MouseEntered/MouseExited that you can use for mouseover handling. | |
Re: You can create a new subclass of JButton, and just override its paintComponent method to paint it however you want. (Not nececssarily the best way to do that particular task, but since this is a follow-up to your earlier posts about painting in Swing, that's the most relevant general answer.) … | |
Re: I assume that you did take a quick moment to Google *JAX-WS vs JAX-RS* before asking for help... Having read the first few answers from that search, what uncertainities are you trying to get resolved here? | |
Re: If you don't mind me asking... why are you doing all that? It looks like the kind of template people used to squeeze the max animation speed from pre 1.5 Swing (before double buffering) back in the days when you measured CPU speed in MHz. But why in 2013? | |
Re: Without code we can only guess - but one interpretation of that listing is that maybe you keep creating instances of JDBC4Connection that are not being garbage collected - ir you are holding on to a reference to all of them somewhere | |
Re: if (Level_0.getValueAt(row, col) = true) You have a = (assignment) where you should have == (equals) (plus then see posts above) if (something == true) //row and col is the location of ckbox in the table Level_0 {Level_0.setValueAt(row, col).setSelected(false);} else {Level_0.getValueAt(row, col).setSelected(true);} is a really long and tortuous way to … | |
Re: You are just using standard Swing components, so there is no need for you to write (or even think about) a paint method. Swing will paint all those components for you. Why exactly do you want to write a custom ppaint method??? | |
Re: Lines 28-35 you put the data into every row of the array, rather than just into the current row then in 38-43 you overwrite your values again when you should be just printing them. | |
Re: When you specify a package Java expects a directory structure to match the package, and you need to use the full package name. Have a look at example 2 here: http://www.cis.upenn.edu/~matuszek/cit594-2002/Pages/packages.html | |
Re: See http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners | |
Re: I hate to disagree with masijade, but the API doc for Scanner says > public String nextLine() > > Advances this scanner past the current line and returns the input that was skipped. This method returns the rest of the current line, ***excluding any line separator at the end.*** It … | |
Re: There is no ASCII code for any of those characters, which is why you get 63 ('?'). ASCII is a 7 bit code that just has the unaccented english characters and some punctuation. http://en.wikipedia.org/wiki/ASCII That's why Java uses UNICODE. | |
Re: Welcome to DaniWeb It looks like your class structure is wrong. Your "naming" class looks like a customer or client Account, in which case a deposit or a withdrawal should not extend naming because they are not a "kind of" naming. A deposit or withdrawal basically needs two things: an … | |
Re: I coudb't see any source code in that zip. How are you handling the screenpaints? Are you overriding Swing's default double-buffering in any way? | |
Re: There are quite a few threads here on this topic. Basically Java doesn't do .exe files because they are operating system dependent. An executable jar will run on any system witha JRE installed. There are some products around that will package up a jar with a jre to give a … | |
Re: sin. cos etc use angles in radians, your data (30) looks like degrees. | |
Re: > non-static method dispenseCash(int) cannot be referenced from a static context Pretty much what is says. dispenseCash is an instance method, and must be called using an instance of CashDispenser, but you try to call it just using the class name (as if it was a static method), so the … | |
Re: The constructor you posted won't compile, so maybe post the right version? public FullTimeEmp(String inFirstName, String inLastName,double) { | |
I know this is going to be really simple, and I'm going to look like a fool when someone answers it, but... I'm tryingto replace any occurrenxe of any of these characters - ?_ with a * in a String I start with replaceAll("[ _-]", "*"); and all is well … | |
Re: A JPanel object is initialized to use a FlowLayout, unless you specify differently when creating the JPanel. So in the second case you are adding to a FlowLayout (using a BorderLayout parameter for an unspecified result) | |
Re: `import static` imports any static final variables from a class (eg Colors from the Color class). Youu probably should be using just `import com.healthmarketscience.jackcess.Database.*; ` to import the classes. | |
Re: The easiest way to get (e to the power something) is to use `Math.exp(something)`, eg eToThePowerFour = Math.exp(2*2); | |
Re: the next() method just takes the next token from the input stream, using the default delimiter of white space. So if the input is "a b c\n" on one line (\n is the new line character), next() will return "a" the first tine you call it, "b" the second call … | |
Re: DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there. | |
Re: > i want to learn C# ... Then maybe Java isn't the way to do that. The languages are almost identical, but the vast libraries that you use with them are totally different (.net vs Java API). Learn one language and you have 90%+ of the other (either way), but … | |
Re: OK, thats some Java code. Is there a question or point you want to make? ps Rather than the nested finally/try your code would be simpler with a Java 7 "try with resources". | |
Re: Don't have Eclipse here at this instant, but it's something like: right click project > Properties > Build Path > Libraries > select librray jar in list > Edit > add path in Documentation tab. | |
Re: You don't say what kind of image you have, but ordinary Image objects have a getScaledInstance(...) method that will give you a new version of whatever size you want. | |
Re: You didn't try well enough. I just downloaded the code from that page and ran it and it works perfectly. | |
Re: Your copy constructor seems to make an ordinary (shallow) copy of the old Team's values. As Ketsuekiame explained your new Team still refers to the same Competition objects as the original Team object. That's just an ordinary "shallow" copy. For a deep copy you must create new Competition objects (that … | |
Re: Alternatively... why would you accept all the overhead and potential conflict of using a very large and complex class like JPanel when you don't use any of its methods? | |
Re: There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) … | |
Re: Lots of `if (...) {` without any matching } that I can see. Indent the code according to the actual brackets and see if that makes sense | |
Re: That code looks like it does try to supply the email and password. Does appcfg.cmd get its email & password from stdin? | |
Re: In that case,, yes. But to make things clearer people often use the same names for the variables and the parameters class X { String name; public X(String name) { this.name = name; // now I need "this" to refer to the variable not the parameter } | |
Re: 11 22 33 44 55 66 77 | | | / / / 11 22 33 55 66 77 See what's happened: for each entry before 44 you just copy the values, end for each entry after 44 you copy the element one up, ie before user's number newAr[i] = … | |
Re: They both refer to the same object (address on the heap), but for compile-time checking the compiler knows that styledDoc must always refer to some kind of StyledDocument and doc must always refer to some kind of AbstractDocument. The cast is telling the compiler that you expect these types to … | |
Re: Once you create a Java object you can never change or convert it to another type of object. Maybe what you need here is to create a list of new CatUI's, and have each CatUI contain a referemce to the Cat that it will display. Something along these lines... class … | |
Re: javascript is a simple language mostly used for adding functionality to web pages. It's pretty easy and quick to learn. Java is a full-scale programming language with a vast API library of thousands of functions that you can use for a huge range of systems. It's very widely used to … | |
Re: Go to the "Problems" tab in the window at the bottom (currently showing "Console") to get a complete list of all the compilation errors that the red underlines are flagging. That will give you complete error descriptions that you or we can use to fix this. | |
Re: What code are you using/trying to put those values into your text fields and combo box? | |
Re: You shouild know by now that we are going to ask for the exact complete text of all your error messages. "My main problem is with blah" is not in any way helpful. | |
Re: What is the software? Does it have installation instructions? Does it have a web site? | |
Re: PrintRequestAttributeSet is just an interface, HashPrintRequestAttributeSet is a class that implements PrintRequestAttributeSet. | |
Re: I see you creating a new output stream each time, but not closing it - maybe they are not being garbage collected? You may also find [this thread](http://www.daniweb.com/software-development/java/threads/254810/find-the-differences-between-two-images-and-the-locations-of-the-differences/) interesting - a few of us were trying to optimise compressing a stream of real-time screen images to send over a socket … | |
Re: I'm not sure what the real question is here, so here's an answer that may or may not hit the target, but at least it may help clarify the question. As the user enters new questions you add them to your Tree structure(s). At the end of each run you … |
The End.