•
•
•
•
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
![]() |
•
•
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
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
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
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,576
Reputation:
Rep Power: 18
Solved Threads: 184
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.
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.
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
•
•
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
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.
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.
•
•
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
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..
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..
•
•
Join Date: May 2006
Location: homeworkhelp.co.in
Posts: 790
Reputation:
Rep Power: 4
Solved Threads: 59
•
•
•
•
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 ?
cout << Homework Help << Freelance Services << Top 10 Web Host;
cout << Build A Website << Interview Question And Answer << Tax Filing;
cout << Build A Website << Interview Question And Answer << Tax Filing;
•
•
Join Date: Nov 2007
Location: Nigeria
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
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));
}
}
}
}
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));
}
}
}
}
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,576
Reputation:
Rep Power: 18
Solved Threads: 184
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
- help me set path (Java)
- compiling from command line (Java)
- Compiling (Java)
- linking java with fortran under Windows OS (C++)
- Compiling And Running (Java)
- Java awt and swing event handling (Java)
- User interface problems (Java)
Other Threads in the Java Forum
- Previous Thread: How to get the values for checked and unchecked chekboxes
- Next Thread: Export/Import Excel in java



Linear Mode