You left off another choice:
Therapy
:P
You left off another choice:
Therapy
:P
You will need to use file locking. There are methods for controlling this in FileChannel.
You could of course just put that code in a regular method and call it from your other listeners. Why do you feel it needs to be another class?
If it does need to be a class, then yes, you can call it like jwenting wrote, but of course you will need to supply the method parameter. A null will suffice if you aren't actually using the ActionEvent param for anything. If you tried to call it with no parameter then certainly it didn't work.
You just need to move the call to setSize() after pack(). Read the method description on pack() and you will see where the sizing issue is coming from.
Well, a couple of things. This query makes little sense
executeQuery("select * from result where result='"+ b1 + "'");
The field name in the where clause is the same as the table name.
Second, after you run the query and call .next(), you need to retrieve the field value like so
String value = rest.getString("theFieldNameYouWant");
msg.setText(value);
If you have other errors, post them.
Sorry, didn't mean to hijack - I just figured since we were both having the same exact problem, I'd let you know I was interested in anything you found out.
Unfortunately, I can't really paste my code. It's about 800 lines long, and I'm not really allowed to by my work.
What I can tell you though is that all I want to do is set the icon inside of the action command, and it's not working. I've tried setting the text, icon, background color - nothing seems to work. Nothing updates the display. I've even made these calls later, sequentially in the code, and the GUIs not getting updated.
It's really frustrating. I don't know how my code got this way. Any ideas on what's going on when you make calls to a component, and that component doesn't display the latest call?
Then just post the action command code. I have a feeling you are not setting the properties on the button you think you are, since calling button.setIcon() in an action does generally update the icon without needing any other calls i.e.
private class ButtonAction extends AbstractAction {
public void actionPerformed(ActionEvent e) {
JButton btn = (JButton)e.getSource();
btn.setIcon(btn.getIcon()==ico1 ? ico2 : ico1);
}
}
Will toggle between each icon as the button is pressed.
It takes a big man to cry, but it takes a bigger man to laugh at that man.
- Jack Handy
If all of the religious adherents throughout the world acknowledged that, regardless of beliefs on what is to be after death, in the mean time we are all stuck on this big ball of dirt together and focus solving the problems of the present, we would be much better off for it.
I'm disgusted by the extent to which religion is a source of conflict and strife rather than a remediation of it.
For detailed information on object-oriented programming in Java, this free online book is a good resource:
http://www.smart2help.com/e-books/tij-3rd-edition/TIJ3.htm
It does not cover new things that have been added with 1.5 and 1.6, but it is still very relevant to the language basics.
For small code examples of all kinds of "how do I do this?" type questions, this can be helpful:
http://www.exampledepot.com/index.html
More tutorial links can be found here:
http://www.daniweb.com/forums/thread82784.html
Passed along from my wife:
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=130144061675&ru=http%25
Those of you who voted Single in the poll may want to consider this additional information.
See section 6.4 Validating User Input here:
http://hudzilla.org/phpwiki/index.php?title=HTML_forms
More complex validation can be performed with regex functions:
http://www.php.net/manual/en/ref.pcre.php
A tutorial showing form validation with preg_match can be found here:
http://www.htmlcenter.com/tutorials/tutorials.cfm/149/PHP/
Since numbers are valid characters, if you don't want them in the field then you will have to check for that prior to saving them to the table.
The int(3) spec does not limit the values to three or less digits. Here is the section describing what it does from the MySQL docs:
Another extension is supported by MySQL for optionally specifying the display width of integer data types in parentheses following the base keyword for the type (for example, INT(4)). This optional display width is used to display integer values having a width less than the width specified for the column by left-padding them with spaces.
The display width does not constrain the range of values that can be stored in the column, nor the number of digits that are displayed for values having a width exceeding that specified for the column. For example, a column specified as SMALLINT(3) has the usual SMALLINT range of -32768 to 32767, and values outside the range allowed by three characters are displayed using more than three characters.
Once again, you will need to validate the data before saving it.
show me the link for Dictionary project
Her code is attached to the first post. Did you bother to read anything at all before posting this question on a thread that is years old? Additionally, your vocabulary could be improved with the addition of some terms of common courtesy such as "Please".
That depends on how the data is generated. Does it go to an output window? File? The program you are working on will need to establish some form of input stream from the output of the exe. You would need to provide some more detail if you need more specific help.
Have you tried copying the $sql string to phpMyAdmin and running the query directly? If you are getting no errors, perhaps your WHERE criteria are not selecting the row you intend.
For one, you don't show any <form> or submit button. Secondly, your php is setting the variables after your HTML has been processed, so the variables in there have no value yet. The following revision works
<?php
$ch1 = 'unchecked';
$ch2 = 'unchecked';
$ch3 = 'unchecked';
$ch4 = 'unchecked';
if (isset($_POST['submit'])) {
if (isset($_POST['ch1'])) {
$ch1 = $_POST['ch1'];
if ($ch1 == 'choc') {
$ch1 = 'checked';
}
}
if (isset($_POST['ch2'])) {
$ch2 = $_POST['ch2'];
if ($ch2 == 'liqu') {
$ch2 = 'checked';
}
}
if (isset($_POST['ch3'])) {
$ch3 = $_POST['ch3'];
if ($ch3 == 'wine') {
$ch3 = 'checked';
}
}
if (isset($_POST['ch4'])) {
$ch4 = $_POST['ch4'];
if ($ch4 == 'lolli') {
$ch4 = 'checked';
}
}
}
?>
<form method='post' action='<?php $_SERVER['PHP_SELF'] ?>'>
<p class="choice">
Please choose the confectionary you would like to buy
<br/>
liquorice:
<input type="checkbox" name="ch1" value="choc" <?PHP print $ch1; ?>/>
<br />
chocolate:
<input type="checkbox" name="ch2" value="liqu" <?PHP print $ch2; ?> />
<br />
lollipops:
<input type="checkbox" name="ch3" value="wine" <?PHP print $ch3; ?> />
<br/>
fruitgums:
<input type="checkbox" name="ch4" value="lolli" <?PHP print $ch4; ?> />
<br/>
<input type='submit' name='submit' value='submit'/>
</form>
</p>
(I didn't bother to put indents back in since you didn't use code tags. If you use code tags your formatting will be retained and it will be much easier to read.)
there is a table called 'guestbook', though, you're right... it doesn't seem to be called in view.php since there is just
select * from guestbook
unless this 'guestbook' refers to the table... since the db and the table are called the same...
The 'guestbook' in that query is the table name. If you do have a table called guestbook then all is fine. Either way, that would not produce the behavior you are getting.
The GridBagLayout would accomplish this very easily.
http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html
i need the information about project-online share trading in java
Sounds like you have some research to do then... Google would probably be a good start.
I know someone has said single = not married but in my mind single = one. So plenty of people here might not be single but not married.
Anywho, not married myself (duh). Don't want to be. It's nothing more than a piece of paper to me. You love someone they should know it, you shouldn't have to stand up infront of people and sign a document to prove it.
Well, not sure how things go over in the UK, but in the US that piece of paper confers rights of survivorship, visitation, custody of children, and such. My wife knows I love her, but without that piece of paper the hospital doesn't and would not let me visit her were she to be in an Intensive Care Unit. Nor would the state accept that any assets bearing her name were our assets if she were to unexpectedly pass away. The piece of paper does confer some rights that come with the decision to enter into a lifelong union with another and without the paper you're pretty much just acquaintances in a legal sense.
it stops working right
echo "<b>Name:|<--here-->|</b>|<--or here-->|"
Yes, that part is clear. Have you checked what is coming from your query for anything like tags that could be interfering as a few people above have mentioned? The code itself looks okay.
Firstly, I do not see anywhere in your main() method where you create a SoftWareSales object. You will need such an object to store the properties and call your methods on.
As far as using getter/setter
SoftwareSales someSoftware = new SoftwareSales( <all that constructor info here - I'm not going to type it all> );
// to get sales (using a getter)
double currentSales = someSoftware.getSales();
// to set number (using the setter)
double currentNumber = 75;
someSoftware.setNumber( currentNumber );
I would think you'd want an && condition there, not an ||.
if (!userData.getName().startsWith("<") && !userData.getName().endsWith(">") )
Check your parenthesis on the if() statement.
And which query are you having trouble with? Post what you currently have that is not working correctly.
userData.endsWith(">")
perhaps?
Edit: yeah, charAt(userData.length()-1) works just as well
Your question is not clear at all. Is the table you posted your "customer_table" or the output that you require? If that is the desired output you will need to post the structure of the customer_table as well if you need help with the query. Also, post your current queries ithat are not working to your expectation.
Shows my level of newbness on java, I am a vbscipt/asp guy trying to learn some java for client side.
I am open to any code to accomplish what I need.
You should post this question and code in the Web Development / Javascript forum. As has been pionted out, this forum is for Java questions, which is not the same thing as Javascript.
You might want to take a look at this for distributing your MySQL database:
http://dev.mysql.com/downloads/connector/mxj/5.0.html
It wouldn't hurt to move the include down into the other block before the query and add the semi-colon. Something is definitely kicking it into HTML parsing mode there.
did you try it? i mean, the whole 'combo'?
No, as that would entail creating db tables as well :)
according to what i know, it shouldn't affect... since it is a single command...
still... tried it, and no response... the same exact results...
Yes, I wondered about it and a couple quick tests here came up the same. The semi-colon did not matter. That was the only thing that stood out that might have caused it to switch parsing modes. I don't really see anything else yet that would be problematic.
I would suspect this lack of a semi-colon might be causing your problem
<?php include("dbconnect.php") ?>
though I'm not sure why you aren't getting an immediate script error from it.
Yes, evidence that he existed, but nothing about what he actually did in his life. From what I understand, there is evidence that he lived, and was a carpenter... but nothing about where he went, who he met, etc. There is just bits of evidence that cannot prove he did anything that was claimed in the bible.
There is more in the historical record of him than that, however I am not disputing that much of the information on his character and deeds stems from gospels which by their nature are of questionable veracity.
>Incorrect. As I understand it, there is quite a bit of historical evidence outside of the bible that supports his existence.
No one is disputing Jesus's existence.
Actually Josh was in the previous post.
This is asp and javascript - not Java. Perhaps you would get more help over in those forums, as this one is for Java programming. At a glance though, those extremely long nested switch statements make me cringe.
The fact of the matter is, you can't prove that jesus was who he said he was.
Plausible and debatable, yes.
There is no proof that he actually did any miracles at all..
Correct, only anecdotal accounts
In fact, there is very little real evidence about him at all.. (The bible doesn't count, as it is a bunch of biased bull crap.)
Incorrect. As I understand it, there is quite a bit of historical evidence outside of the bible that supports his existence.
I haven't seen this. But what's disturbing about it?
<shudder> I hope you are not serious.
At the camp, Fischer stresses the need for children to purify themselves in order to be part of the "army of God." She strongly believes that children need to be in the forefront of turning America toward conservative Christian values. She also feels that Christians need to focus on training kids since "the enemy" are focused on training theirs.
>>this will have to be something that ALL christian sects believe
1. Jesus Christ was born, lived, died, raised from the dead and ascended into heaven.2. The goodhood consists of three members: God the Father, God the Son and God the Holy Ghost (AKA the trienity of the goodhood).
3. The only way to get to heaven is thru Jesus Christ.
4. We are all sinners and require God's forgiveness to get to heaven.
Theologians might quibble, but that seems to me a pretty viable base distillation.
Okay, this is rather long but I just retrieved a bible study we did at my church a while back on this subject.
<snip so quote doesn't fill so much space>A true Christian is a person who has put his or her faith and trust in the person of Jesus Christ and fact that He died on the cross as payment for sins and rose again on the third day to obtain victory over death and to give eternal life to all who believe in Him. John 1:12 tells us: “But as many as received Him, to them He gave the right to become children of God, to those who believe in His name.” A true Christian is indeed a child of God, a part of God’s true family, and one who has been given new life in Christ. The mark of a true Christian is love for others and obedience to God’s Word (1 John 2:4; 1 John 2:10).
Humans are never perfect, so even I can't call myself a "True Christian..." but I am a Christian because I am the definition of that word. I am a follower of Jesus Christ.
I looked pretty hard in all that but failed to find the part about going to bars and parties being a disqualifier. If I missed it, feel free to bold the relevant section.
But gay men do molest younger boys. I've heard and read about it so many times.
As do some straight men molest younger girls. Neither behavior is acceptable.
I know... but no one's listening.
Listening to what? Your assertion that it is clearly written without any inclusion of that really clear part?
For the last time, it's not my beliefs. It's written clear as day in the Bible what a Christian truly is!
Addressed in my post just prior to Josh's, previous page.
How? It's clearly written!
Clearly written as in specifying "the bar, strip clubs, parties, etc"? Many adjectives might describe the bible, but "clear" isn't one of them. If clarity was so apparent there would be a single denomination "Christian" as opposed to the over 300 listed in Wikipedia (yes, not an exhaustive research source by any means, but they do list 300 and state that they haven't even listed them all)
http://en.wikipedia.org/wiki/List_of_Christian_denominations
From the same entry above
Between denominations, theologians and comparative religionists, there are considerable disagreements about which groups can be properly called Christian. These disagreements rise primarily from doctrinal differences between groups. For the purpose of simplicity, this list is intended to reflect the self-understanding of each denomination. Explanations about different opinions concerning their status as Christian denominations can be found at their respective articles.
It would seem that a few people are missing that clarity.
MY expectations?? Actually, that would be the Bible's expectations. =/ I'm not God you know.
As you well know, disagreements over the expectations of the Bible abound and it's interpretation is hugely fragmented. Very few Christian denominations can wholly agree on the should and should not of it's entirety. That is exactly my point. You mentioned a few things that you viewed as "not really Christian" and labeled anyone who did them as hypocrites. Therefore, your estimate was based on your expectations. If you wish to claim they are the expectations of the bible, fine, but don't expect to pass that off as universally agreed upon amongst all Christians.
the problem is in the way such figures are measured.
Often census polls will not give you enough options to make your true beliefs (or lack thereof) known.
For example you get a poll asking for your religion. The options are
1) Christian
2) Muslim
3) Atheist
4) HinduIf you're neither, what do you pick? Most people will pick the religion closest to their background, which in a traditionally Christian region would be Christian.
Often also when you leave a question open the people handling the results will just pick the first item on the list instead, because they have to fill in something.
Understood. Polling itself imposes limits on the usefulness or accuracy of the information obtained.
But as to 50% of the US being Christian, I think that's pretty correct.
Note that's not 50% of people actually going to church every sunday and really believing in the whole thing wholeheartedly.
Most of them believe in Christian values without being actively religious, may even share Christian believes but aren't members of any organised church group.
With "believe in Christian values" as the metric, I would accept the 50% as a reasonable sounding guess. Christina's comment though cited "hypocrisy" or failure to adhere to her expectations of what "real Christian" entailed as the metric for her lowered estimate. That is where I believe the estimate becomes meaningless.
Given that definition I too would be termed a Christian, altough …
My purpose is purposeful for of course me, my God, and my life. How is my understanding of this "rather narrowly constrained?"
The comment was only in reference toward your mention of living life with no purpose, which to me sounded as if you were discounting a life free of religion as without purpose.
You call that a fact? It's an opinion. I could say the same thing about living your life with no purpose whatsoever... how does that help?
So purpose is only established through belief in a God? It must be externally imposed rather than self-directed? Purposeful towards whom or what? Your understanding of purpose seems rather narrowly constrained.
People don't believe God exists because they've never tried to believe.
Fixed for you. The nature of Faith precludes knowing. This statement is merely circular.