Need some help.

Hi! I'm having trouble getting the input from my JTextfields in nyskiva to the class VinylRecord and then to my ArrayList allaskivor...

I just dont know where to start (I've only put in listeners to the buttons) and would greatly appreciate a nudge in the right direction.



[code]
import java.util.*;

import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.*;

import javax.swing.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class VinylLibrary extends JFrame{
private JTextArea textArea;
ArrayList allaSkivor = new ArrayList ();

public VinylLibrary() {
super("Skivsamling");
setLayout(new BorderLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel searchPanel = new JPanel();
JTextField searchField = new JTextField(15);

JButton searchButton = new JButton("Filtrera");
searchButton.addActionListener(new searchLyss());

searchPanel.add(searchField);
searchPanel.add(searchButton);

add(searchPanel, BorderLayout.NORTH);

JButton newButton = new JButton("Ny...");
newButton.addActionListener(new newButtonLyss());

JButton removeButton = new JButton("Ta bort...");
removeButton.addActionListener(new removeLyss());

JPanel buttonRow = new JPanel();
buttonRow.add(newButton);
buttonRow.add(removeButton);

add(buttonRow, BorderLayout.SOUTH);

textArea = new JTextArea();
textArea.setEditable(false);
textArea.setRows(10);

add(new JScrollPane(textArea), BorderLayout.CENTER);

setSize(400, 300);
setVisible(true);
}



class searchLyss implements ActionListener{
public void actionPerformed(ActionEvent ave){

}
}

JTextField titel = new JTextField(15);
JTextField artist = new JTextField(15);
JTextField
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories