我需要显示链接,所以我正在使用带有setContentType的JTextPane.但是,内容不会换行,也没有滚动.JTextPane的内容将从RSS源返回.这是完整的代码:
import java.awt.*;
import javax.swing.*;
class Main extends JFrame
{
JFrame frame;
JTabbedPane tabbedPane;
JPanel home, news;
public Main()
{
setTitle("My Title" );
setSize( 900, 600 );
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
home();
news();
tabbedPane = new JTabbedPane();
tabbedPane.addTab( " Home", home );
tabbedPane.addTab( "News", news );
JPanel framePanel = new JPanel();
framePanel.setLayout(new BorderLayout());
framePanel.add( tabbedPane, BorderLayout.CENTER );
getContentPane().add( framePanel );
}
public void home()
{
home = new JPanel();
// some stuffs here
}
public void news()
{
news = new JPanel(); …Run Code Online (Sandbox Code Playgroud) 当数据库中的数据(股票名称和价格)与Yahoo Finance的数据(股票名称和价格)匹配时,我的程序将提醒用户.在HarryJoy的帮助下,我能够实现弹出通知.
现在的问题是,所有功能仅适用于最后一帧(YHOO).5秒后或单击closeButton时不会处理().谢谢!

if (stockPriceDB == popStockValue)
{
String header = "Stock: " + stock.getTicker() + " is now @ " + stock.getPrice();
String message = "";
popUpFrame = new JFrame();
popUpFrame.setSize(320,90);
popUpFrame.setUndecorated(true);
popUpFrame.getContentPane().setLayout(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = 0;
constraints.weightx = 1.0f;
constraints.weighty = 1.0f;
constraints.insets = new Insets(5, 5, 5, 5);
constraints.fill = GridBagConstraints.BOTH;
JLabel headingLabel = new JLabel(header);
ImageIcon headingIcon = new ImageIcon("images/alert.gif");
headingLabel.setIcon(headingIcon);
popUpFrame.getContentPane().add(headingLabel, constraints);
constraints.gridx++;
constraints.weightx = …Run Code Online (Sandbox Code Playgroud) 我正在使用路径来创建特定的形状。对所有路径进行分组的最佳方法是什么,以便稍后我可以在另一个位置使用它们而无需重新定位路径?
任何建议都会很棒,谢谢!