小编Lil*_*y S的帖子

JTextPane不显示JScrollPane,也不显示文本

我需要显示链接,所以我正在使用带有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)

java swing jtextpane

5
推荐指数
1
解决办法
3549
查看次数

Dispose()不适用于每一帧

当数据库中的数据(股票名称和价格)与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)

java notifications swing dispose popup

4
推荐指数
1
解决办法
1773
查看次数

如何在 WPF 中对路径进行分组?

我正在使用路径来创建特定的形状。对所有路径进行分组的最佳方法是什么,以便稍后我可以在另一个位置使用它们而无需重新定位路径?

任何建议都会很棒,谢谢!

wpf geometry-path

2
推荐指数
1
解决办法
3619
查看次数

标签 统计

java ×2

swing ×2

dispose ×1

geometry-path ×1

jtextpane ×1

notifications ×1

popup ×1

wpf ×1