2021-07-16 00:37:03 +02:00
|
|
|
|
|
|
|
import javax.swing.JFrame;
|
2021-07-16 01:07:23 +02:00
|
|
|
import javax.swing.JPanel;
|
2021-07-16 00:37:03 +02:00
|
|
|
import javax.swing.JMenuBar;
|
|
|
|
import javax.swing.JMenu;
|
2021-07-29 10:03:32 +02:00
|
|
|
import javax.swing.JMenuItem;
|
2021-07-16 01:07:23 +02:00
|
|
|
import javax.swing.JButton;
|
|
|
|
import javax.swing.JLabel;
|
|
|
|
import javax.swing.Box;
|
|
|
|
import javax.swing.BorderFactory;
|
|
|
|
import java.awt.Graphics;
|
2021-07-29 10:03:32 +02:00
|
|
|
import java.awt.FontMetrics;
|
2021-07-16 00:37:03 +02:00
|
|
|
import java.awt.Dimension;
|
2021-07-16 01:07:23 +02:00
|
|
|
import java.awt.BorderLayout;
|
|
|
|
import java.awt.GridLayout;
|
2021-07-29 10:03:32 +02:00
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
import java.awt.event.ActionEvent;
|
2021-07-16 01:07:23 +02:00
|
|
|
import java.util.List;
|
|
|
|
import java.util.ArrayList;
|
2021-07-16 00:37:03 +02:00
|
|
|
|
|
|
|
class
|
2021-07-29 10:03:32 +02:00
|
|
|
PostWindow extends JFrame
|
|
|
|
implements ActionListener {
|
2021-07-16 00:37:03 +02:00
|
|
|
|
2021-07-16 11:46:17 +02:00
|
|
|
private Post
|
|
|
|
post;
|
|
|
|
|
|
|
|
// - -%- -
|
|
|
|
|
2021-07-16 00:37:03 +02:00
|
|
|
private PostComponent
|
2021-07-16 11:46:17 +02:00
|
|
|
postDisplay;
|
2021-07-16 00:37:03 +02:00
|
|
|
|
|
|
|
private RepliesComponent
|
2021-07-16 11:46:17 +02:00
|
|
|
repliesDisplay;
|
2021-07-16 00:37:03 +02:00
|
|
|
|
2021-07-29 10:03:32 +02:00
|
|
|
// ---%-@-%---
|
2021-07-17 13:17:14 +02:00
|
|
|
|
2021-07-29 10:03:32 +02:00
|
|
|
public void
|
|
|
|
setPost(Post post)
|
2021-07-17 13:17:14 +02:00
|
|
|
{
|
2021-07-29 10:03:32 +02:00
|
|
|
if (post == null)
|
|
|
|
{
|
|
|
|
post = new Post();
|
|
|
|
post.text = "This is a sample post.";
|
|
|
|
post.authorId = "snowyfox@biskuteri.cafe";
|
|
|
|
post.authorName = "snowyfox";
|
|
|
|
post.date = "0712hrs, 17 July";
|
|
|
|
post.visibility = PostVisibility.MENTIONED;
|
|
|
|
post.postId = "000000000";
|
|
|
|
post.boosted = false;
|
|
|
|
post.favourited = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.post = post;
|
|
|
|
|
2021-07-29 11:26:16 +02:00
|
|
|
List<RepliesComponent.Reply> replies = null;
|
|
|
|
{
|
|
|
|
List<Post> posts = null;
|
|
|
|
// We should make a request to JKomasto here.
|
|
|
|
}
|
|
|
|
if (replies == null)
|
|
|
|
{
|
|
|
|
RepliesComponent.Reply reply1, reply2, reply3;
|
|
|
|
reply1 = new RepliesComponent.Reply();
|
|
|
|
reply1.author = "Black tea";
|
|
|
|
reply1.text = "Rich..";
|
|
|
|
reply2 = new RepliesComponent.Reply();
|
|
|
|
reply2.author = "Green tea";
|
|
|
|
reply2.text = "Clean!";
|
|
|
|
reply3 = new RepliesComponent.Reply();
|
|
|
|
reply3.author = "Coffee";
|
|
|
|
reply3.text = "sleepy..";
|
|
|
|
|
|
|
|
replies = new ArrayList<>();
|
|
|
|
replies.add(reply1);
|
|
|
|
replies.add(reply2);
|
|
|
|
replies.add(reply3);
|
|
|
|
}
|
|
|
|
|
2021-07-29 10:03:32 +02:00
|
|
|
postDisplay.setAuthor(post.authorName);
|
|
|
|
postDisplay.setTime(post.date);
|
|
|
|
postDisplay.setText(post.text);
|
2021-07-29 11:26:16 +02:00
|
|
|
repliesDisplay.setReplies(replies);
|
2021-07-17 13:17:14 +02:00
|
|
|
}
|
|
|
|
|
2021-07-31 13:36:56 +02:00
|
|
|
public void
|
|
|
|
openAuthorProfile()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
favourite()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
boost()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
reply()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
openMedia()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-07-29 10:03:32 +02:00
|
|
|
// - -%- -
|
2021-07-17 11:46:27 +02:00
|
|
|
|
|
|
|
public void
|
2021-07-29 10:03:32 +02:00
|
|
|
actionPerformed(ActionEvent eA)
|
2021-07-17 11:46:27 +02:00
|
|
|
{
|
2021-07-29 10:03:32 +02:00
|
|
|
Object src = eA.getSource();
|
|
|
|
if (!(src instanceof JMenuItem)) return;
|
|
|
|
String text = ((JMenuItem)src).getText();
|
|
|
|
|
|
|
|
if (text.equals("Post"))
|
|
|
|
{
|
|
|
|
setContentPane(postDisplay);
|
|
|
|
revalidate();
|
|
|
|
/*
|
|
|
|
* (知) Setting a content pane in itself doesn't
|
|
|
|
* do anything to the content pane. Validation
|
|
|
|
* of the validate root does. Which happens on
|
|
|
|
* window realisation, or by manual call.
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
else if (text.equals("Replies"))
|
|
|
|
{
|
|
|
|
setContentPane(repliesDisplay);
|
|
|
|
revalidate();
|
|
|
|
}
|
2021-07-17 11:46:27 +02:00
|
|
|
}
|
|
|
|
|
2021-07-16 00:37:03 +02:00
|
|
|
// ---%-@-%---
|
|
|
|
|
|
|
|
PostWindow()
|
|
|
|
{
|
2021-07-16 11:46:17 +02:00
|
|
|
getContentPane().setPreferredSize(new Dimension(360, 270));
|
|
|
|
pack();
|
|
|
|
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
2021-07-16 00:37:03 +02:00
|
|
|
setLocationByPlatform(true);
|
|
|
|
|
2021-07-31 13:36:56 +02:00
|
|
|
postDisplay = new PostComponent(this);
|
2021-07-16 11:46:17 +02:00
|
|
|
|
|
|
|
repliesDisplay = new RepliesComponent();
|
2021-07-29 10:03:32 +02:00
|
|
|
|
|
|
|
setPost(null);
|
2021-07-16 00:37:03 +02:00
|
|
|
|
|
|
|
JMenu postMenu = new JMenu("Post");
|
2021-07-29 10:03:32 +02:00
|
|
|
addToMenu(postMenu, "Favourite");
|
|
|
|
addToMenu(postMenu, "Reply");
|
2021-07-16 11:46:17 +02:00
|
|
|
JMenu displayMenu = new JMenu("Display");
|
2021-07-29 10:03:32 +02:00
|
|
|
addToMenu(displayMenu, "Post");
|
|
|
|
addToMenu(displayMenu, "Replies");
|
2021-07-16 00:37:03 +02:00
|
|
|
JMenuBar menuBar = new JMenuBar();
|
|
|
|
menuBar.add(postMenu);
|
2021-07-16 11:46:17 +02:00
|
|
|
menuBar.add(displayMenu);
|
2021-07-31 13:28:46 +02:00
|
|
|
//setJMenuBar(menuBar);
|
2021-07-16 00:37:03 +02:00
|
|
|
|
2021-07-17 11:46:27 +02:00
|
|
|
setContentPane(postDisplay);
|
2021-07-29 10:03:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private void
|
|
|
|
addToMenu(JMenu menu, String text)
|
|
|
|
{
|
|
|
|
JMenuItem item = new JMenuItem(text);
|
|
|
|
item.addActionListener(this);
|
|
|
|
menu.add(item);
|
2021-07-16 00:37:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-07-16 01:07:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class
|
2021-07-31 13:36:56 +02:00
|
|
|
PostComponent extends JPanel
|
|
|
|
implements ActionListener {
|
|
|
|
|
|
|
|
private PostWindow
|
|
|
|
primaire;
|
2021-07-16 01:07:23 +02:00
|
|
|
|
|
|
|
private String
|
|
|
|
author, time, text;
|
|
|
|
|
2021-07-31 13:28:46 +02:00
|
|
|
// - -%- -
|
|
|
|
|
|
|
|
private JButton
|
|
|
|
profile,
|
|
|
|
favouriteBoost,
|
|
|
|
replyMisc,
|
2021-07-31 13:36:56 +02:00
|
|
|
nextPrev,
|
2021-07-31 13:28:46 +02:00
|
|
|
media;
|
|
|
|
|
2021-07-16 01:07:23 +02:00
|
|
|
// ---%-@-%---
|
|
|
|
|
|
|
|
public void
|
|
|
|
setAuthor(String author)
|
|
|
|
{
|
|
|
|
assert author != null;
|
|
|
|
this.author = author;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
setTime(String time)
|
|
|
|
{
|
|
|
|
assert time != null;
|
|
|
|
this.time = time;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
setText(String text)
|
|
|
|
{
|
|
|
|
assert text != null;
|
|
|
|
this.text = text;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - -%- -
|
|
|
|
|
2021-07-31 13:36:56 +02:00
|
|
|
public void
|
|
|
|
actionPerformed(ActionEvent eA)
|
|
|
|
{
|
|
|
|
Object src = eA.getSource();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Umm, ActionEvent is the wrong thing to listen for here.
|
|
|
|
* We want mouse presses. The custom button would publish
|
|
|
|
* events that mention which button it was.
|
|
|
|
*
|
|
|
|
* Default JButton ignores RMB.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (src == profile)
|
|
|
|
{
|
|
|
|
primaire.openAuthorProfile();
|
|
|
|
}
|
|
|
|
else if (src == favouriteBoost)
|
|
|
|
{
|
|
|
|
// Fancy!!
|
|
|
|
}
|
|
|
|
else if (src == replyMisc)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (src == nextPrev)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (src == media)
|
|
|
|
{
|
|
|
|
primaire.openMedia();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-16 01:07:23 +02:00
|
|
|
protected void
|
|
|
|
paintComponent(Graphics g)
|
|
|
|
{
|
2021-07-16 11:46:17 +02:00
|
|
|
int lineHeight = 20;
|
2021-07-29 10:03:32 +02:00
|
|
|
|
|
|
|
FontMetrics met = g.getFontMetrics();
|
|
|
|
|
2021-07-31 13:28:46 +02:00
|
|
|
int x1 = 56;
|
|
|
|
int x2 = getWidth() - met.stringWidth(time);
|
|
|
|
int y1 = lineHeight;
|
|
|
|
|
|
|
|
g.drawString(author, x1, y1);
|
|
|
|
g.drawString(time, x2, y1);
|
2021-07-16 01:07:23 +02:00
|
|
|
|
2021-07-31 13:28:46 +02:00
|
|
|
int y = y1;
|
2021-07-16 11:46:17 +02:00
|
|
|
for (String line: split(text, 48)) {
|
2021-07-31 13:28:46 +02:00
|
|
|
y += lineHeight;
|
|
|
|
g.drawString(line, x1, y);
|
2021-07-16 11:46:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private List<String>
|
|
|
|
split(String string, int lineLength)
|
|
|
|
{
|
|
|
|
List<String> returnee = new ArrayList<>();
|
|
|
|
|
|
|
|
int start, max = string.length();
|
|
|
|
for (start = 0; start < max; start += lineLength) {
|
|
|
|
returnee.add(string.substring(
|
|
|
|
start,
|
|
|
|
Math.min(max, start + lineLength)
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
return returnee;
|
2021-07-16 01:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ---%-@-%---
|
|
|
|
|
2021-07-31 13:36:56 +02:00
|
|
|
PostComponent(PostWindow primaire)
|
2021-07-16 01:07:23 +02:00
|
|
|
{
|
2021-07-31 13:36:56 +02:00
|
|
|
this.primaire = primaire;
|
|
|
|
|
2021-07-16 11:46:17 +02:00
|
|
|
author = time = text = "";
|
|
|
|
|
2021-07-31 13:28:46 +02:00
|
|
|
profile = new JButton("P");
|
|
|
|
profile.setSize(40, 40);
|
2021-07-31 13:36:56 +02:00
|
|
|
profile.addActionListener(this);
|
2021-07-31 13:28:46 +02:00
|
|
|
|
|
|
|
favouriteBoost = new JButton("☆/B");
|
|
|
|
favouriteBoost.setSize(40, 40);
|
2021-07-31 13:36:56 +02:00
|
|
|
favouriteBoost.addActionListener(this);
|
2021-07-31 13:28:46 +02:00
|
|
|
// We have to overload the buttons to accept RMBs.
|
|
|
|
// Which perform the secondary functionality.
|
|
|
|
|
|
|
|
replyMisc = new JButton("R");
|
|
|
|
replyMisc.setSize(40, 40);
|
2021-07-31 13:36:56 +02:00
|
|
|
replyMisc.addActionListener(this);
|
2021-07-31 13:28:46 +02:00
|
|
|
|
2021-07-31 13:36:56 +02:00
|
|
|
nextPrev = new JButton("↓/↑");
|
|
|
|
nextPrev.setSize(40, 40);
|
|
|
|
nextPrev.addActionListener(this);
|
2021-07-31 13:28:46 +02:00
|
|
|
|
|
|
|
media = new JButton("M");
|
|
|
|
media.setSize(40, 40);
|
2021-07-31 13:36:56 +02:00
|
|
|
media.addActionListener(this);
|
2021-07-31 13:28:46 +02:00
|
|
|
|
|
|
|
setLayout(null);
|
|
|
|
profile.setLocation(8, 8); add(profile);
|
|
|
|
favouriteBoost.setLocation(8, 8+48); add(favouriteBoost);
|
|
|
|
replyMisc.setLocation(8, 8+48+48); add(replyMisc);
|
2021-07-31 13:36:56 +02:00
|
|
|
nextPrev.setLocation(8, 8+48+48+48); add(nextPrev);
|
2021-07-31 13:28:46 +02:00
|
|
|
media.setLocation(8, 8+48+48+48+48); add(media);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Also, since it's a linear buttons now, we can just use
|
|
|
|
* a Box or FlowLayout. Though we have to have a JPanel
|
|
|
|
* for the left, and this text component on the right.
|
|
|
|
* If we are custom rendering the text then we can stay
|
|
|
|
* this way, with manual positioning.
|
|
|
|
*/
|
|
|
|
|
2021-07-16 11:46:17 +02:00
|
|
|
setFont(getFont().deriveFont(14f));
|
2021-07-16 01:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class
|
|
|
|
RepliesComponent extends JPanel {
|
|
|
|
|
2021-07-29 11:26:16 +02:00
|
|
|
private List<RepliesComponent.Reply>
|
|
|
|
replies;
|
|
|
|
|
|
|
|
// - -%- -
|
2021-07-16 01:07:23 +02:00
|
|
|
|
|
|
|
private JButton
|
|
|
|
prevPage, nextPage;
|
|
|
|
|
|
|
|
private JLabel
|
|
|
|
pageLabel;
|
|
|
|
|
2021-07-29 10:03:32 +02:00
|
|
|
private ReplyPreviewComponent[]
|
|
|
|
previews;
|
|
|
|
|
2021-07-16 01:07:23 +02:00
|
|
|
// ---%-@-%---
|
|
|
|
|
|
|
|
public void
|
2021-07-29 11:26:16 +02:00
|
|
|
setReplies(List<RepliesComponent.Reply> replies)
|
2021-07-16 01:07:23 +02:00
|
|
|
{
|
2021-07-29 11:26:16 +02:00
|
|
|
assert replies != null;
|
|
|
|
this.replies = replies;
|
2021-07-29 10:03:32 +02:00
|
|
|
displayPage(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - -%- -
|
|
|
|
|
|
|
|
private void
|
|
|
|
displayPage(int pageNumber)
|
|
|
|
{
|
2021-07-29 11:26:16 +02:00
|
|
|
assert pageNumber > 0;
|
|
|
|
assert this.replies != null;
|
|
|
|
|
|
|
|
List<RepliesComponent.Reply> page;
|
2021-07-29 10:03:32 +02:00
|
|
|
{
|
2021-07-29 11:26:16 +02:00
|
|
|
int oS = (pageNumber - 1) * 8;
|
|
|
|
int oE = Math.min(oS + 8, replies.size());
|
|
|
|
if (oS > oE) page = new ArrayList<>();
|
|
|
|
else page = this.replies.subList(oS, oE);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int o = 0; o < page.size(); ++o)
|
|
|
|
{
|
|
|
|
assert o < previews.length;
|
|
|
|
|
2021-07-29 10:03:32 +02:00
|
|
|
ReplyPreviewComponent preview = previews[o];
|
2021-07-29 11:26:16 +02:00
|
|
|
Reply reply = replies.get(o);
|
|
|
|
preview.setAuthor(reply.author);
|
|
|
|
preview.setText(reply.text);
|
|
|
|
preview.setVisible(true);
|
|
|
|
}
|
2021-07-29 10:03:32 +02:00
|
|
|
|
2021-07-29 11:26:16 +02:00
|
|
|
for (int o = page.size(); o < previews.length; ++o)
|
|
|
|
{
|
|
|
|
ReplyPreviewComponent preview = previews[o];
|
|
|
|
preview.setVisible(false);
|
2021-07-29 10:03:32 +02:00
|
|
|
}
|
2021-07-29 11:26:16 +02:00
|
|
|
|
|
|
|
int pages = 1 + ((replies.size() - 1) / 8);
|
|
|
|
pageLabel.setText(pageNumber + "/" + pages);
|
2021-07-29 11:40:52 +02:00
|
|
|
prevPage.setEnabled(pageNumber > 1);
|
|
|
|
nextPage.setEnabled(pageNumber < pages);
|
2021-07-29 11:26:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ---%-@-%---
|
|
|
|
|
|
|
|
public static class
|
|
|
|
Reply {
|
|
|
|
|
|
|
|
public String
|
|
|
|
author;
|
|
|
|
|
|
|
|
public String
|
|
|
|
text;
|
|
|
|
|
2021-07-16 01:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ---%-@-%---
|
|
|
|
|
|
|
|
RepliesComponent()
|
|
|
|
{
|
|
|
|
prevPage = new JButton("<");
|
|
|
|
nextPage = new JButton(">");
|
|
|
|
prevPage.setEnabled(false);
|
|
|
|
nextPage.setEnabled(false);
|
|
|
|
|
2021-07-29 11:26:16 +02:00
|
|
|
pageLabel = new JLabel();
|
2021-07-16 01:07:23 +02:00
|
|
|
|
|
|
|
Box bottom = Box.createHorizontalBox();
|
|
|
|
bottom.add(Box.createGlue());
|
|
|
|
bottom.add(prevPage);
|
2021-07-17 11:37:00 +02:00
|
|
|
bottom.add(Box.createHorizontalStrut(8));
|
2021-07-16 01:07:23 +02:00
|
|
|
bottom.add(pageLabel);
|
2021-07-17 11:37:00 +02:00
|
|
|
bottom.add(Box.createHorizontalStrut(8));
|
2021-07-16 01:07:23 +02:00
|
|
|
bottom.add(nextPage);
|
|
|
|
|
|
|
|
JPanel centre = new JPanel();
|
2021-07-17 11:37:00 +02:00
|
|
|
centre.setOpaque(false);
|
2021-07-16 01:07:23 +02:00
|
|
|
centre.setLayout(new GridLayout(0, 1, 0, 2));
|
2021-07-29 10:03:32 +02:00
|
|
|
|
|
|
|
previews = new ReplyPreviewComponent[8];
|
|
|
|
for (int o = 0; o < previews.length; ++o)
|
|
|
|
{
|
|
|
|
previews[o] = new ReplyPreviewComponent();
|
|
|
|
previews[o].setVisible(false);
|
|
|
|
centre.add(previews[o]);
|
2021-07-16 01:07:23 +02:00
|
|
|
}
|
|
|
|
|
2021-07-17 11:37:00 +02:00
|
|
|
setLayout(new BorderLayout(0, 8));
|
2021-07-16 01:07:23 +02:00
|
|
|
add(centre, BorderLayout.CENTER);
|
|
|
|
add(bottom, BorderLayout.SOUTH);
|
|
|
|
|
2021-07-17 11:37:00 +02:00
|
|
|
setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
|
2021-07-29 11:26:16 +02:00
|
|
|
|
|
|
|
setReplies(new ArrayList<>());
|
2021-07-16 01:07:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-07-17 11:37:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
class
|
|
|
|
ReplyPreviewComponent extends JButton {
|
|
|
|
|
|
|
|
private String
|
|
|
|
author;
|
|
|
|
|
|
|
|
private String
|
|
|
|
text;
|
|
|
|
|
|
|
|
// ---%-@-%---
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void
|
|
|
|
setText(String text)
|
|
|
|
{
|
|
|
|
assert text != null;
|
|
|
|
this.text = text;
|
|
|
|
setText();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void
|
|
|
|
setAuthor(String author)
|
|
|
|
{
|
|
|
|
assert author != null;
|
|
|
|
this.author = author;
|
|
|
|
setText();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - -%- -
|
|
|
|
|
|
|
|
private void
|
|
|
|
setText()
|
|
|
|
{
|
|
|
|
StringBuilder text = new StringBuilder();
|
|
|
|
text.append(this.author);
|
|
|
|
text.append(" @ ");
|
|
|
|
text.append(this.text);
|
|
|
|
super.setText(text.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void
|
|
|
|
paintComponent(Graphics g)
|
|
|
|
{
|
|
|
|
g.drawString(getText(), 8, 2 * getHeight() / 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|