7,116 Posted Topics

Member Avatar for TokamakFusion
Member Avatar for london-G

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 …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Shizuo

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 …

Member Avatar for JamesCherrill
0
452
Member Avatar for untio

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 …

Member Avatar for untio
0
215
Member Avatar for fmasroor

MouseListener has methods for MouseEntered/MouseExited that you can use for mouseover handling.

Member Avatar for JamesCherrill
0
209
Member Avatar for murali2489

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.) …

Member Avatar for murali2489
0
1K
Member Avatar for pmark019

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?

Member Avatar for Ne0nx3r0
0
755
Member Avatar for vinnitro

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?

Member Avatar for vinnitro
0
283
Member Avatar for newbie14

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

Member Avatar for newbie14
0
948
Member Avatar for mikewyatt

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 …

Member Avatar for ageshyaw
0
2K
Member Avatar for murali2489

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???

Member Avatar for JamesCherrill
0
338
Member Avatar for JoeD1

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.

Member Avatar for stultuske
0
282
Member Avatar for murali2489

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

Member Avatar for murali2489
0
280
Member Avatar for gauravagg2

See http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners

Member Avatar for JamesCherrill
0
558
Member Avatar for mrosario

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 …

Member Avatar for mrosario
0
2K
Member Avatar for lena1990

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.

Member Avatar for TokamakFusion
0
163
Member Avatar for muhammad.a.haq

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 …

Member Avatar for muhammad.a.haq
0
222
Member Avatar for vinnitro

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?

Member Avatar for JamesCherrill
0
2K
Member Avatar for Mr.M

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 …

Member Avatar for JamesCherrill
0
163
Member Avatar for reincom
Member Avatar for Mr.M

> 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 …

Member Avatar for Mr.M
0
600
Member Avatar for murali2489

The constructor you posted won't compile, so maybe post the right version? public FullTimeEmp(String inFirstName, String inLastName,double) {

Member Avatar for murali2489
0
206
Member Avatar for JamesCherrill

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 …

Member Avatar for masijade
1
237
Member Avatar for somjit{}

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)

Member Avatar for somjit{}
0
355
Member Avatar for Andy_2

`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.

Member Avatar for JamesCherrill
0
316
Member Avatar for reincom

The easiest way to get (e to the power something) is to use `Math.exp(something)`, eg eToThePowerFour = Math.exp(2*2);

Member Avatar for reincom
0
109
Member Avatar for benjo.s.lucas

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 …

Member Avatar for JamesCherrill
0
194
Member Avatar for java_help

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.

Member Avatar for JamesCherrill
-2
548
Member Avatar for mc.sQr

> 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 …

Member Avatar for JamesCherrill
0
279
Member Avatar for RazaAjmi

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".

Member Avatar for stultuske
0
153
Member Avatar for emanhossnycs

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.

Member Avatar for JamesCherrill
0
219
Member Avatar for london-G

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.

Member Avatar for JamesCherrill
0
290
Member Avatar for NaikTharki

You didn't try well enough. I just downloaded the code from that page and ran it and it works perfectly.

Member Avatar for JamesCherrill
0
277
Member Avatar for ross.clare.5

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 …

Member Avatar for jwenting
0
1K
Member Avatar for DavidKroukamp

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?

Member Avatar for JamesCherrill
3
2K
Member Avatar for rnana

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) …

Member Avatar for JamesCherrill
-2
270
Member Avatar for christine.dunne.963

Lots of `if (...) {` without any matching } that I can see. Indent the code according to the actual brackets and see if that makes sense

Member Avatar for pbj.codez
0
190
Member Avatar for emanhossnycs

That code looks like it does try to supply the email and password. Does appcfg.cmd get its email & password from stdin?

Member Avatar for emanhossnycs
0
300
Member Avatar for murali2489

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 }

Member Avatar for murali2489
0
198
Member Avatar for joma.tioquin

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] = …

Member Avatar for joma.tioquin
0
408
Member Avatar for somjit{}

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 …

Member Avatar for somjit{}
0
222
Member Avatar for bhanu1607

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 …

Member Avatar for JamesCherrill
0
337
Member Avatar for shockwave4uonly
Re: java

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 …

Member Avatar for jwenting
-1
151
Member Avatar for kilermage

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.

Member Avatar for kilermage
0
204
Member Avatar for afifah.hamidon
Member Avatar for afifah.hamidon
0
148
Member Avatar for Mr.M

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.

Member Avatar for Mr.M
0
143
Member Avatar for SAM2012

What is the software? Does it have installation instructions? Does it have a web site?

Member Avatar for SAM2012
0
303
Member Avatar for somjit{}

PrintRequestAttributeSet is just an interface, HashPrintRequestAttributeSet is a class that implements PrintRequestAttributeSet.

Member Avatar for somjit{}
0
327
Member Avatar for Vaspar

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 …

Member Avatar for JamesCherrill
0
712
Member Avatar for cjap20

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 …

Member Avatar for JamesCherrill
0
2K

The End.