小编Chr*_*ris的帖子

Eclipse"错误:无法找到或加载主类"

我在笔记本电脑上有一个eclipse项目,我推送到Git https://github.com/chrisbramm/LastFM-History-Graph.git

它在我的笔记本电脑上完全运行并且运行/构建没有问题,但在我的桌面上它没有Eclipse给出错误

错误:无法找到或加载主类lastfmhistoryguis.InputPanel

我尝试过构建项目:

Project>Build Project
Run Code Online (Sandbox Code Playgroud)

但什么都没发生.我已PATH将此计算机上的变量设置为JRE6,JRE7和JDK 1.7.0,即使这些变量未在我的笔记本电脑上设置.

我确实有JAR文件(last.fm-绑定-0.1.1.jar这是在我的).classpath文件,该文件是在C:\用户\克里斯\下载我的笔记本电脑,因此它是不包括在GIT树的文件夹,我最近进入项目文件夹并承诺,但我不确定我是否做得对.这也会导致问题,但那里没有主要论点.

我现在无法解决,我需要检查/更改.

java eclipse git jar classpath

100
推荐指数
12
解决办法
48万
查看次数

Java updateUI 只工作一次

这是我正在构建的应用程序https://github.com/chrisbramm/LastFM-History-Graph

下面是src/lastfmhistoryclasses. 当OutputGUIView创建它创建三个组成部分,一JPanel graphPanel,这是添加到JScrollPane graphScrollPanel和其他JPanel autocompletePanel。然后这些都被添加到JFrame OutputGUIView. 下面的侦听器会更改首选大小,graphPanel并且在您第一次按下按钮时,UI 会更新以显示graphPanel大小已增加且滚动条graphScrollPanel已更改。

但是,现在,如果您按下另一个按钮,首选大小会发生变化,但 UI 不会更新,如果您通过最大化它来更改窗口尺寸,它会这样做。

class Zoom2000 implements ActionListener{
    public void actionPerformed(ActionEvent e){
        outputGUIView.graphPanel.setPreferredSize(new Dimension(screenWidth, 2000));
        outputGUIView.graphScrollPanel.updateUI();

    }
}
class ZoomDefault implements ActionListener{
    public void actionPerformed(ActionEvent e){
        outputGUIView.graphPanel.setPreferredSize(new Dimension(screenWidth, screenHeight));
        outputGUIView.graphScrollPanel.updateUI();


    }
}
class Zoom6000 implements ActionListener{
    public void actionPerformed(ActionEvent e){
        outputGUIView.graphPanel.setPreferredSize(new  Dimension(screenWidth, 6000));
        outputGUIView.graphScrollPanel.updateUI();

    }
}
Run Code Online (Sandbox Code Playgroud)

我也尝试了不同的东西,例如invalidate/validate/revalidate(和重新绘制)各种组件,而 graphPanel 只是坐在那里,只有在您更改窗口尺寸时才重新绘制。

任何想法我做错了什么? …

java swing

0
推荐指数
1
解决办法
6367
查看次数

标签 统计

java ×2

classpath ×1

eclipse ×1

git ×1

jar ×1

swing ×1