peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

By downloading appropriate JAR file and adding to your project libraries. The following code snippet show some example of Java mailing plus has some links. You can find more of material for it with google

wujianwei commented: HELPFUL +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you paid more attention in your classes you would know that Applet DO NOT USE "main" class call. For more info follow Sun Applet tutorials here

Nick Evan commented: Good correction, I should stay with c++ not java ;) +5
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Retrive name and video location from database
  2. Prefix video file location string with rest of the path
  3. Pass this new generated string path to media player
majestic0110 commented: Good plan. Wanted to reply myself but couldn't think of a good response! +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Any reason for this complicated approach, mix of PHP and JavaScript if you can do it better with PHP on its own?

PS after merge: Please do not flood forum with multiple posts!

tefflox commented: posted a non-useful response with an infraction....... +0
~s.o.s~ commented: Equlizer; one performing mod duties should never be needlessly penalized. +21
majestic0110 commented: Agree with ~s.o.s.~ there. Peter you always moderate fairly and efficiently! +3
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Layouts are your friends

add(topPanel, BorderLayout.NORTH);

You should have go on these tutorials

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@jbennet - this sort of topic students do from all over the world, it is just UK that is realy behind, or put it this way they are lowering expectations each year (most common BSc project is shopping website with some database, with bad functionality and horible design, seen it last year when I did my BSc, seeing this year while finishing MSc)

So you thinking in Java and some networking, what about bluetooth ad-hoc network, take scenario there is bad catastrophy that took out mobile network in the are. People need to setup communication, most commont thing on mobile phone beside camera and walkman is bluetooth. Communication through BT is not complex what is challenging is how you gone manage record of available connections, routes to other people, number of hops and how you gone manage trafic?

Nick Evan commented: excellent suggestion +4
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

For long time I wanted to find out how to store images in database but never had time to try it so I can not say what is best approach or recommend any technique. Best thing you can do is look up some resources on google like these and try them on your own

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I was about give you positive rep, but the comment on bottom change my mind.

[ if this post is helpful to you then please add reputation to me. thanks in advance. ]

Scrounging for positive rep is not nice, be ashamed :angry:

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

maybe "unsocial persona" ;)

~s.o.s~ commented: Heh, how about 'destination - Dani post count!' ;-) +20
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Declare JRadioButtonMenuItem as follow

String[] difLevel = {"Easy", "Normal", Hard"};
JRadioButtonMenuItem[] difficulty;

Initialization somewhere in code with adding ActionListener

difficulty[] = JRadioButtonMenuItem[difLevel.length];
for(int i = 0; i < difficulty.length; i++)
{
	difficulty[i] = new JRadioButtonMenuItem(difLevel[i]);

	//add to file menu that you already declared in your code
	file.add(difficulty[i]);

	difficulty[i].addActionListener(itemHandler);
}

Listener will be something like this

private class ItemHandler implements ActionListener
{
	public void actionPerformed(ActionEvent ae)
	{
		for( int i=0; i < difficulty.length; i++)
		{
			if(event.getSource() == difficulty[i])
			{
				/*
				 * YOUR DIFFICULTY LEVEL SETUP CODE HERE
				 */
			}
		}
	}
}
toomuchfreetime commented: Great help.! Much Appreciated.Much taken from post +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

i hv used css nd html in my website currently too all i want you is to guide me tht how i shall start making the template i have seen means hw i can convert it into the template one..............

We strive to be a community geared towards the professional. We strongly encourage all posts to be in full-sentence English. Please do not use "leet" speak or "chatroom" speak.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You should know the answer, you are the master mind behind this ;)

Ancient Dragon commented: another test +23
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
Majestics commented: Great, It helped in my research +7
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

XML elements must follow these naming rules:

  • Names must not start with a number or punctuation character

A name was started with an invalid character. Error processing resource 'file:///C:/Documents and Settings/Phil/Desktop/1.x...

That what is your problem

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do not worry so far sara_84 did not reply to anything originaly posted in first or second post. I would say it is pass deadline.
Anyone want to help me with coursework?. Joking:P

darkagn commented: lol +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Read this, it holds some interesting info

Jishnu commented: Nice link :) +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

JDBC tutorial that can help to start

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Merry Christmas and Happy New Year!

I wish you all the best in your personal and professional lifes...

Ancient Dragon commented: nice images +21
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is javax.imageio as part of Java that you can use. However not always suficient for the task. You may want to consider Java Advance Imaging or even better Java Advanced Imaging Image I/O. Please take the note that this sugestions are good as far image resizing is done on the server. You would not be able to implement it on mobile device derictly!
There could be solution if you use Advanced Graphics and User Interface (AGUI) Optional Package for Java Platform, Micro Edition (JSR-209) or one of the custom libraries for 2D & 3D from companies like Nokia or Sony Ericsson but I did not try them yet.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

can you make those photos larger?

No need for it, if you will try that program you would understand what he is about....


GridLayout is not best solution for the layout you try to do. You should consider BoxLayout, GridBagLayout or combination of more then one. So if we look at first image you can split it on 3 main sections

  1. Labels, text fields, combobox and buttons in top part
  2. Text area from middle
  3. Two buttons from bottom

Then top part can be split on following

  • 3 text fields with their labels from left
  • text field with label from middle together with combo box(this can be also split but not necessary)
  • 2 buttons from the right

Hope that helps

iamthwee commented: Useful, well planned reply +11
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Same mistake in both cases

  • you store user input into Department but compared variable is dept, I think you forgot to parse String Department to integer dept so whole time you run check on null value of dept int dept=0;
  • your last attempt iCez actually work once parse implemented
    if (dept<=3){
       System.out.println("You belong to: Mr.X");
       }else if (dept>=4&&dept<=7){
       System.out.println("You belong to: Mr.Y");
       }else if (dept>=8&&dept<=9){
       System.out.println("You belong to: Mr.Z");
       }
  • Another option is code bellow which also deal with number out of boundaries 1 - 9
import java.io.*;
public class Test5
{
	public static BufferedReader input=new BufferedReader (new InputStreamReader(System.in));
	public static void main(String args[])
	{
		String Department;
		int dept=0;
		try{
		System.out.println("Enter Department:");
		Department=input.readLine();
		dept = (int) Integer.parseInt(Department);
		}
		catch(IOException ioe) {}
		
		if(dept>7 && dept<10){
		System.out.println("You belong to: Mr.Z");
		}else if (dept>3 && dept<8){
		System.out.println("You belong to: Mr.Y");
		}else if (dept>0 && dept<4){
		System.out.println("You belong to: Mr.X");
		}
		else{
		System.out.println("Department not recognice");
		}
	}
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No, you have to first call currently selected item String selectedOption = (String) jComboBoxMonth.getSelectedItem() and then you can compare it as you did it if (selectedOption.equals("Month")

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1. Is there any reason for currCD = 0? Do you use it for something?

2. CdwArtist cdEntry = (CdwArtist)listModel.elementAt(i); will retrive data about CD on position "i" of your list.
What is cdNameField.getText() for? Is it the way you retrieve CD name from cdEntry object?
Just checking few lines bellow it is not! cdNameField.setText(newCD.getName());

Ezzaral commented: Yes, he was completely missing all the hints I tried to give him. I really didn't want to just write code for him, but the points just wouldn't stick. +1
no1zson commented: Always helpful, even when I am showing little to no progress +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Hi..

I am developing an internal messenger where i need to prepare documentation .so can anyone help me ASAP.........

Thanks n Regards

ASAP that sounds bad, are we kind of monkeys working for you?
Search daniweb there are already posts about messengers.
Check sourceforge for open source project to get idea how this works.

masijade commented: I am a trained monkey, just not his. ;-) +4
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you please provide remining classes for this application. So far I do no see any problems here so copaling whole thing would be better

no1zson commented: LOTS of help. Love to see his name in my thread. +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
JTextArea jta = new JTextArea();
jta.append("CD Description");
//Or you can do
jta.setText("CD Description");

Preferences up to you just look up API

no1zson commented: Thanks for trying. +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

In command prompt type

java -version

and return can be something like this

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
vinod_javas commented: doing good job! +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

In your case I will stay on the forum which you so strongly promote and improve it as it is dreadful...
Either provide help as requested or don't say anything

Ezzaral commented: Agreed. I've been over to that forum - it's awful. +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Then do it with command propmpt here is some explanation

iamthwee commented: good +12
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Heh, it's interesting that you got positive reputation for that post.

I did not asked for it!
However looks like others share my opinion or maybe it was done on purpose "you complain about it, you don't like so here goes extra reputation which you do not enjoy.."

joshSCH commented: you complain about it, you don't like so here goes extra reputation which you do not enjoy.. +16
sk8ndestroy14 commented: Haha, no offense. +7
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you searched forum before you posted, you would find that just yeasterday I linked another post with same quastion to my post where I asked same thing few months ago with full elaboration of the problem. Here is link http://www.daniweb.com/forums/thread73182.html, enjoy reading and next time search before you post, there is huge possibility somebody already made a topic with same/similar problem

thekashyap commented: Seriously donno when will they learn to use search.. ! +3
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you care so much about your increase of reputation points get in pack with few other people and start giving reputation points each other as we already can see with some members...
One of the pack get bad reputation so another mate give him equalizer and as this not being enought other give him good reputation just because he did same for him other time. Soon we will see people with 20 green reputation marks.

This whole thing turn out to be competition for some people "just look how great is my reputation", but it doesn't not tell you that the person is not always politle, it does not fully reflect how much/little community work that person actualy did...

So treat this reputation thing as you wish.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

iamthwee I have to step up for ~s.o.s~. He did not exposed any of us showing these addresses. Details provided by ~s.o.s~ are still inaccurate, to get to us he would need to tres pass on ISP users database. Also so far I did not find any resource which would be able to say, so this person with the IP has this name and live at this address.
Regarding moderators and other admin having access to your registration details, well you have to leave with it and trust them they will not misused them. That is gamble for every site where you need to register in order to be able access.

Now let me show you what I use for IP tracing. :)

jbennet commented: exactly +16
~s.o.s~ commented: Thanks for understanding the joke ;-) +20
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

>1)what do I needs to install before start coding?
Java ofcourse http://java.sun.com/javase/downloads/index.jsp

>2)what environment(notepad,wordpad,..)do you offer me to try in?
notepad is my preference, later you can get IDE's such as JCreator, Eclipse, NetBeans but that is up to you

>3)what ever you think may help me to start java programming?
Java's own website is good source of tutorials http://java.sun.com/docs/books/tutorial/ or I did use Java How To Program, 6th edition from Deitel and Deitel

and have funn

iamthwee commented: good +9
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Every 100 points you get new block.
Now, however reputation points seems to be pointless as point are given just for complimentary note or deffending your buddy in coffee house and not stuff like reporting bad posts or valuable information in technical section where everything actualy started. So choose your alliance

Rashakil Fol commented: Let's see how long this can be. aoeuhtnsaoeuhtnsaoeuhtns aoeuhtns aouehtn saoeuhtn saoeu htnsa oeuh tnsao euhtn aoheus ntaoheu aoteuhna oetuhsanoteuh atnoesutha oesnuh asntoeuhs antohe santoh eusnatoeu hao etuhsa onteuh aotneauhsoteuh aoneu haontuhe +6
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You don't need array of numbers, you want to have ready array of image locations and then call position of element in array based on your random number to upload your image

String[] displayImg = {"img1.jpg", "img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg"};
Integer a = (int) (Math.random() * 5);
Image myImg = Toolkit.getDefaultToolkit().getImage(displayImg[a]);
R1D1CUL3 commented: Perfect!!! Thanks SOO Much!!! +0
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I would suggest to sort the array first and then it is simple just reguest number on second possition. Also keep in mind that you may have first two number of same value so the second smallest should be on 3rd position(but that is just extra feature of your program)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Next time please let us know that you using different API

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you can be specific about confusion on loops, arrays and if/else we can try to help you. Also there is always java tutorial site
if/else
switch
do-while/while
for
array

and do lot of practice

volscolts16 commented: Thank You the Java Tutorial looks like it might be a big help. I appreciate it!! +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
Hellodear commented: Thanks for your reply. I found it is valuable to me +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Would you mind post rest of the code? As from that one line we can't find anything

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

The source for that class must live in a plain text file with the same name (including case), with a *.java extension.
I am bit confused still about the use of "*":

Asterix "*" stands for any, it this case they just try to say put there a name you want like myApplet.java. Also "plain text file" is little distracting but take it that this way, they expect you to type your code in notepad and when saving give it java extention. Not everybody start with IDE's, I did my first few months of coding in notepad and compiled all in command prompt :cheesy:

To the rest of your question about applet and Panorama.init I can't comment, I did only requered part of applet coding at university and never returned back to it again. It didn't impress me :rolleyes:

mattyd commented: help with applets\\ thanks, mattyd +3
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
select max(table1_id) from table1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Give us code what you did, because without any attempt made nobody will help you here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I think you should reconsider your for loop

for(i='A';i<'D';i++)

I never heard that in java you can increase value of character type variable, this is possible but in Perl
Create array of characters and with use of "i" get the character from the array
so if char[] myArray = { 'A', 'B', 'C'}
then if i = 1
you get character B

ajay_tabbu commented: nice +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is no add method for JScrollPane so you can't use it but there is JScrollPane constructor JScrollPane(Component view), which "Creates a JScrollPane that displays the contents of the specified component, where both horizontal and vertical scrollbars appear whenever the component's contents are larger than the view." (taken fro JAVA API)
check Java API here

JTextArea t;
	JFrame f;
	JPanel c;
	JScrollPane b;
	//b = new JScrollPane();
	b.setAutoscrolls(true);
	f = new JFrame("JNotepad");
	f.setBounds(300, 200, 500, 500);
	c = new JPanel();
	f.setContentPane(c);
	t = new JTextArea();
	t.setFont(Font.decode("Courier New-14"));
	b = new JScrollPane(t);
	c.add(b);
	f.setJMenuBar(/* Menu bar is "m". This works just fine. */m);
	f.setVisible(true);
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

ever heard of Pythagoras' Theorem " a on power of two plus b on power of two equals to c on power of two"?
just example

(x1 - x2 ) = x           // your a
(y1 - y2) = y            // your b

if ( x < 0) then x * (-1)
if ( y < 0) then y * (-1)

x^2 + y^2 = z^2       // z is your c distance between pixels    this ^2 on power of two

then get square root
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This is getting bad. Teroris tried to attack again on 4 different locations.
What is even worster is, one of the attack happend on the bus which I usually take to work.
Unfortunately this guy run a way, hide somewhere between my work place and my recant home. Police is searching for him.

Hope they get them :evil:

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I am supposed to write an query which will add new attribute to my already existing table
So I written this

ALTER TABLE member
ADD e_mail CHAR(20)

which is fine, however when I try insert required data for each row I get stuck

INSERT INTO member(e_mail) VALUES('johnwhite@msn.com');

Can anyone help me please....