Note that there are some explanatory texts on larger screens.

plurals
  1. POError during compilation?
    primarykey
    data
    text
    <p>so I have been making a code regarding <code>JPizza.java</code> and I have come to the point where I get this error:</p> <pre><code> JPizza.java:38: error: cannot find symbol music = getAudioClip(getCodeBase(),"katy_perry-roar.mid"); ^ symbol: method getCodeBase() location: class JPizza 1 error </code></pre> <p>I have been trying to figure out why it is giving me these error, but I can't find the main issue here? Is it because I forgot to define a method? For the getCodeBase() and CodeBase() I tried to define it as <code>CodeBase() = getCodeBase()</code> and it then shifts the error to getAudioClip</p> <pre><code>import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.applet.*; public class JPizza extends JFrame implements ItemListener, ActionListener { FlowLayout flow = new FlowLayout(); JLabel companyName = new JLabel("PizzaPalooza"); JComboBox&lt;String&gt; sizeBox = new JComboBox&lt;String&gt;(); JLabel sizeList = new JLabel("Size List"); JComboBox&lt;String&gt; toppingBox = new JComboBox&lt;String&gt;(); JLabel toppingList = new JLabel("Topping List"); JTextField totPrice = new JTextField(10); JLabel orderName = new JLabel("Name of Order"); JTextField oName = new JTextField(15); JLabel listenLabel = new JLabel("Listen to our theme!"); JButton playButton = new JButton("Play"); JButton stopButton = new JButton("Stop"); JLabel headLabel = new JLabel (); AudioClip music; int totalPrice = 0; int sizeNum, toppingNum; int sPrice, tPrice, sumPrice; int[] sizePrice = {0,7,9,11,14}; int[] toppingPrice = {0,0,1,1,1,1}; String output; public void init() { Container con = getContentPane(); con.setLayout (new FlowLayout()); con.add(headLabel); con.add(listenLabel); con.add(playButton); con.add(stopButton); playButton.addActionListener(this); stopButton.addActionListener(this); music = getAudioClip(getCodeBase(),"katy_perry-roar.mid"); } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if(source == playButton) music.loop(); else music.stop(); } </code></pre> <p>for this, but I do not understand what this means?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload