import java.awt.*;
import java.awt.event.*;
import java.swing.*;
import java.util.*;
public class Main extends JFrame implements ActionListener {
private DefaultListModel mod1=new DefaultListModel(),
private DefaultListModel mod2=new DefaultListModel();
private JList 11 = new JList(mod1),
private JList 12 = new JList(mod2);
private JButton to=new JButton(">>"),
delete=new JButton("<<"),
ord=new JButton("order");
private JLabel costLabel=new JLabel("Total Cost: $0");
private int no;
public order() throws IOException {
JPanel arrows=new JPanel();
arrows.setLayout(new GridLayout(2, 1, 0, 10));
arrows.add(to); arrows.add(delete);
JPanel row1=new JPanel(), row2=new JPanel();
getContentPane().add(row1, BorderLayout.Center);
getContentPane().add(row2, BorderLayout.South);
JScrollPane sp1=new JScrollPane(11),
JScrollPane sp2=new JScrollPane(12);
row.add(sp1); row1.add(arrows); row1.add(sp2);
row2.add(costLabel); row2.add(ord);
BufferedReader file=new BufferedReader(
new fileReader("titles.txt"));
String line;
while ((line=file.readLine())!=null)
mod1.addElement(line);
sp2.setVisibleRowCount(10);
sp2.setPreferredSize(sp1.getPreferredSize());
to.addActionListerner(this);
delete.addActionListerner(this);
ord.addActionListerner(this);
pack();
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
jonbc86 0 Newbie Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
jonbc86 0 Newbie Poster
jonbc86 0 Newbie Poster
lucky1981_iway 0 Light Poster
Phaelax 52 Practically a Posting Shark
jonbc86 0 Newbie Poster
jonbc86 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.