User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 361,854 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,623 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 749 | Replies: 9
Reply
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Help Assignment on java 2 j2sdk1.4.2_04

  #1  
Nov 21st, 2007
Hello everyone please i need help ..
i am new 2 java and i was given this assigment of which i dont even know where to start from...If anyone can help please IM me so i can send him the question or perhaps for a little guidance on how to go about everything cuz i will have to defend my project...
Thanks Alot
Anthony
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,576
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 184
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Assignment on java 2 j2sdk1.4.2_04

  #2  
Nov 21st, 2007
no, we're NOT going to do your homework for you and we're NOT going to give you private help.

If you'd paid attention in class you'd by now have known what to do and how to do it, so if you fail it's all your own fault and quite deserved.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
Reply With Quote  
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Re: Assignment on java 2 j2sdk1.4.2_04

  #3  
Nov 23rd, 2007
its ait man, you dont understand i am not askin you to help me do it...
All i needed was just a lil guidelines, common i have been doing it on my own its just gettin a lil bit complicated i can figure it out but time is not on my side but thanks all the same jwenting. i like what you did but dont rush into conclusions ok.
Reply With Quote  
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Help How do i add music..

  #4  
Nov 29th, 2007
hello everyone ..
please i need some one to help with the way i should about add music to play on my java app .
i am doing a project that involves buying music online so i want to add the artist music so that when someone clicks on the artist he'll be able t hear the song of the artist before adding to cart.
thank..
Reply With Quote  
Join Date: May 2006
Location: homeworkhelp.co.in
Posts: 790
Reputation: ithelp is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 59
ithelp ithelp is offline Offline
Master Poster

Re: How do i add music..

  #5  
Nov 29th, 2007
Originally Posted by tactfulsaint View Post
hello everyone ..
please i need some one to help with the way i should about add music to play on my java app .
i am doing a project that involves buying music online so i want to add the artist music so that when someone clicks on the artist he'll be able t hear the song of the artist before adding to cart.
thank..

You can not code website using java, try some server side language like asp/php
Or are you trying to implement java applet ?
Reply With Quote  
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Re: How do i add music..

  #6  
Nov 29th, 2007
yes thats right i was trying to implement java applet . here is the code snipet, please dont lauch cuz am new lol.


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
import java.util.Calendar;
/*
<applet code="The.class" height=20 width=20>
</applet>
*/
public class The extends JApplet implements ActionListener
{
/*D V*/
JPanel panel;
JLabel lo;
JLabel bo;
JLabel wo;
JLabel yo;
JLabel b1;
JLabel l1;
JLabel l2;
JLabel display;
ImageIcon LO;
ImageIcon LO1;
ImageIcon LO2;
ImageIcon LO3;
JButton classic;
JButton western;
JButton pop;
JButton jazz;
JButton add;
JCheckBox tilo;
JCheckBox tila;
JCheckBox tilu;
JCheckBox tile;
JCheckBox tili;
JComboBox cbta;
JTextField bu;
Font f;
GridBagLayout g;
GridBagConstraints gbc;
public void init()
{
/*I L V*/
g=new GridBagLayout();
gbc=new GridBagConstraints();
panel=(JPanel)getContentPane();
panel.setLayout(g);
Icon LogoImage=new ImageIcon("c:/project/music on.gif");
//you will mention the path of your jpg file
l1=new JLabel();
gbc.anchor=GridBagConstraints.EAST;
gbc.ipady=2;
gbc.ipadx=4;
gbc.gridx=4;
gbc.gridy=4;
g.setConstraints(l1,gbc);
panel.add(l1);
panel.setBackground(Color.blue);
/*A C P*/
classic=new JButton("Classic");
gbc.fill=GridBagConstraints.BOTH;
classic.setForeground(Color.red);
classic.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=1;
gbc.gridy=3;
g.setConstraints(classic, gbc);
panel.add(classic);
tilo=new JCheckBox("Gwen Stefani");
tilo.setForeground(Color.red);
tilo.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=2;
gbc.gridy=3;
g.setConstraints(tilo, gbc);
panel.add(tilo);
setSize(6000,9000);
/*A C P*/
western=new JButton("Western");
western.setForeground(Color.red);
western.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=1;
gbc.gridy=4;
g.setConstraints(western, gbc);
panel.add(western);
tila=new JCheckBox("topee");
tila.setForeground(Color.red);
tila.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=2;
gbc.gridy=4;
g.setConstraints(tila, gbc);
panel.add(tila);
/*A C P*/
pop=new JButton("Pop");
pop.setForeground(Color.red);
pop.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=1;
gbc.gridy=5;
g.setConstraints(pop, gbc);
panel.add(pop);

tilu=new JCheckBox("Fergie");
tilu.setForeground(Color.red);
tilu.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=2;
gbc.gridy=5;
g.setConstraints(tilu, gbc);
panel.add(tilu);

/*A C P*/
jazz=new JButton("Jazz");
jazz.setForeground(Color.red);
jazz.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=1;
gbc.gridy=6;
g.setConstraints(jazz, gbc);
panel.add(jazz);
tile=new JCheckBox("10/12/07 10:25");
tile.setForeground(Color.red);
tile.setBackground(Color.blue);
gbc.ipady=1;
gbc.ipadx=1;
gbc.gridx=1;
gbc.gridy=7;
g.setConstraints(tile, gbc);
panel.add(tile);
/*A C P*/
add=new JButton("Add to cart");
add.setForeground(Color.blue);
add.setBackground(Color.green);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=4;
gbc.gridy=7;
g.setConstraints(add, gbc);
panel.add(add);

/*A C P*/
lo=new JLabel("select the category");
lo.setForeground(Color.red);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=1;
gbc.gridy=2;
g.setConstraints(lo, gbc);
lo.setFont(new Font("Helvetical",Font.BOLD,15));
panel.add(lo);
bo=new JLabel("List of all");
bo.setForeground(Color.red);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=2;
gbc.gridy=2;
g.setConstraints(bo, gbc);
panel.add(bo);
tili=new JCheckBox("Funke");
tili.setForeground(Color.red);
tili.setBackground(Color.blue);
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=2;
gbc.gridy=6;
g.setConstraints(tili, gbc);
panel.add(tili);
/*I M*/
LO=new ImageIcon("c:/project/Rihanna.gif");
LO2=new ImageIcon("c:/project/Gwen Stefani.gif");
LO3=new ImageIcon("c:/project/Christina Milian.gif");
LO1=new ImageIcon("c:/project/Fergie.gif");
display = new JLabel();
gbc.anchor = GridBagConstraints.LINE_END;
gbc.gridx = 4;
gbc.gridy = 4;
gbc.ipadx = 3;
gbc.ipady = 4;
g.setConstraints(display, gbc);
panel.add(display);
Icon logoImage=new ImageIcon("c:/project/music on.gif");
b1=new JLabel(logoImage);
gbc.anchor=GridBagConstraints.NORTHEAST;
gbc.ipady=2;
gbc.ipadx=2;
gbc.gridx=4;
gbc.gridy=1;
g.setConstraints(b1,gbc);
panel.add(b1);
classic.addActionListener(this);
western.addActionListener(this);
pop.addActionListener(this);
jazz.addActionListener(this);
tilo.addActionListener(this);
add.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
Object o=ae.getSource();
if(o==classic)
{
display.setIcon(LO);
tilo.setText("Fergie");
tila.setText("Christina Milian");
tilu.setText("Rihanna");
tili.setText("Lagbaja");
}
if(o==western)
{
display.setIcon(LO1);
tilo.setText("Funke");
tila.setText("Keinde");
tilu.setText("T-pain");
tili.setText("Topee");
}
if(o==pop)
{
display.setIcon(LO2);
tilo.setText("Pink");
tila.setText("Britney Spears");
tilu.setText("Limbizkit");
tili.setText("Kelly Clarkson");
}
if(o==jazz)
{
display.setIcon(LO3);
tilo.setText("Kenny G");
tila.setText("Yenny");
tilu.setText("JazzMan");
tili.setText("Lenny");
}
if(add==o)
{
Add myadd = new Add();

/*start changes*/
myadd.init();
myadd.start();

int compCount = panel.getComponentCount();
java.util.Vector componentList = new java.util.Vector();
for(int i = 0; i < compCount; i++)
{
Component c = panel.getComponent(i);
componentList.addElement(c);
}

for(int i = 0; i < componentList.size(); i++)
{
Component c = (Component)componentList.elementAt(i);
panel.remove(c);
}

panel.add(myadd);

//use this method for thread safety
java.awt.EventQueue.invokeLater(new Runnable()
{
public void run() {
javax.swing.SwingUtilities.updateComponentTreeUI(The.this);
}
});
/*end changes*/
{
String months[]= {"jan", "Feb", "Mar", "Apr", "May", "Jun",
"july", "Aug", "Sept", "Oct", "Nov", "Dec"};

Calendar cal = Calendar.getInstance();
System.out.println("The Date is: ");
System.out.print(months[cal.get(Calendar.MONTH)]) ;
System.out.print(" " + cal.get(Calendar.DATE) + " ") ;
System.out.println(cal.get(Calendar.YEAR));

cal.set(Calendar.HOUR, 11);
cal.set(Calendar.MINUTE, 30);
cal.set(Calendar.SECOND, 0);
System.out.print("The Time is: ");
System.out.print(cal.get(Calendar.HOUR) + ":");
System.out.print(cal.get(Calendar.MINUTE) + ":");
System.out.print(cal.get(Calendar.SECOND));
}

}
}
}
Reply With Quote  
Join Date: Jan 2007
Posts: 120
Reputation: stultuske is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 14
stultuske's Avatar
stultuske stultuske is offline Offline
Junior Poster

Re: Assignment on java 2 j2sdk1.4.2_04

  #7  
Nov 30th, 2007
well...
since you've said that you could figure it all out on yourself, I take it you've allready figured out that Java and JavaScript are not the same programming language?
Reply With Quote  
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation: tactfulsaint is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
tactfulsaint tactfulsaint is offline Offline
Light Poster

Re: Assignment on java 2 j2sdk1.4.2_04

  #8  
Dec 2nd, 2007
Thanks man but i could use your help cuz am lost right now.
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,576
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 184
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Assignment on java 2 j2sdk1.4.2_04

  #9  
Dec 3rd, 2007
you said you could figure it all out for yourself, so by definition you're not lost.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
Reply With Quote  
Join Date: Feb 2006
Posts: 1,318
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 7
Solved Threads: 110
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Virtuoso

Re: How do i add music..

  #10  
Dec 3rd, 2007
Originally Posted by ithelp View Post
You can not code website using java, try some server side language like asp/php

I'm sorry (no I'M not), but BS. What is JSP? What do those three letters stand for? What are Servlets programmed in? What are they?
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 5:38 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC