-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDetailsPane.java
42 lines (34 loc) · 1.23 KB
/
DetailsPane.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package Projects;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
public class DetailsPane extends JPanel {
String currentItemName = "";
VoteBox vb;
JLabel title = new JLabel();
public DetailsPane(String cin) {
BorderLayout layout = new BorderLayout();
setLayout(layout);
VoteBox voteBox = new VoteBox();
setPreferredSize(new Dimension(970,250));
setBorder(new TitledBorder("Details"));
add(voteBox, BorderLayout.EAST);
}
public void updateDetails(Proposal p) {
currentItemName = p.getTitle();
setBorder(new TitledBorder("Detailed Information for Proposal: " + "\"" + currentItemName + "\""));
JPanel details = new JPanel(new BorderLayout());
//JEditorPane content = new JEditorPane();
JTextPane content = new JTextPane();
content.setText(p.getDescription());
//content.setEditable(false);
details.add(content, BorderLayout.CENTER);
JPanel titledPane = new JPanel(new BorderLayout());
//titledPane.setBorder(new TitledBorder("Detailed Information for Proposal: " + "\"" + currentItemName + "\""));
titledPane.add(details, BorderLayout.CENTER);add(titledPane);
updateUI();
}
}