小编Alp*_*n67的帖子

在VBA Excel中读取HTML文件

我想阅读VBA中的HTML代码(类似于Java中的URL).我需要将它保存在一个字符串中.我事后解析它.

alpan67

vba

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

在onclick事件上更改按钮的背景图像

为什么这不起作用?在Firebug中,当我点击按钮时,它总是告诉我cambiaBandiera没有定义...

救命

亚历克斯

CSS

#ITA{
float:right;
margin : 5px 85px;
width:40px;
height:40px;
background : #FFFFFF url("../ITA_off.png") center center no-repeat;
border:0;
}
Run Code Online (Sandbox Code Playgroud)

JAVASCRIPT(在HEAD中)

<style type="text/javascript">
function cambiaBandiera() {
test=document.getElementById("ITA");
test.style.backgroundImage="url('../ITA_on.png')";
}
</style>
Run Code Online (Sandbox Code Playgroud)

这是HTML

<div id="bandiere">
<input type="button" id="ITA" onClick="cambiaBandiera()">  </input> 
</div>
Run Code Online (Sandbox Code Playgroud)

html javascript css

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

从文本文件填充JCombobox

我已经看到一个较旧的问题,答案是下面的代码,但如果我使用netbeans,我已经设计了我的comboBox.所以我认为(我想象的是Java和netbeans中的新东西!)代码的最后一行应该改变,我在哪里插入这段代码?

BufferedReader input = new BufferedReader(new FileReader(filePath));
List<String> strings = new ArrayList<String>();
try {
    String line = null;
    while (( line = input.readLine()) != null){
        strings.add(line);
    }
}

catch (FileNotFoundException e) {
    System.err.println("Error, file " + filePath + " didn't exist.");
}
finally {
    input.close();
}

String[] lineArray = strings.toArray(new String[]{});

JComboBox comboBox = new JComboBox(lineArray); 
Run Code Online (Sandbox Code Playgroud)

java file-io swing netbeans jcombobox

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

Class.newInstance()如何使用方法?

我创建了一个抽象类,如下所示:

abstract class Chance
{

   public void setTeams(SportEvent aSportEvent)
   {
      firstTeam = aSportEvent.getFirstTeam();
      secondTeam = aSportEvent.getSecondTeam();
   }


   private int totalPlayedGames()
   {
      int playedAtHome = firstTeam.getHomePlayedGames();
      int playedAway = secondTeam.getAwayPlayedGames();
      int playedGames = playedAtHome + playedAway; 
      return playedGames;
   }


   private int totalScoredGoals()
   {
      int homeScoredGoals = firstTeam.getHomeScoredGoals();
      int awayScoredGoals = secondTeam.getAwayScoredGoals();
      int scoredGoals = homeScoredGoals + awayScoredGoals; 
      return scoredGoals;
   }

   abstract double getChance()

   Team firstTeam;
   Team secondTeam; 
}
Run Code Online (Sandbox Code Playgroud)

然后,当然,我有几个类的方法getChance()...

现在,我想创建一个类,在其中我可以获得getChance()这些新类的结果.我想用的东西是这样的:

Class aClass = Class.forName(chanceClass....);
Object obj = …
Run Code Online (Sandbox Code Playgroud)

java abstract-class class

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

标签 统计

java ×2

abstract-class ×1

class ×1

css ×1

file-io ×1

html ×1

javascript ×1

jcombobox ×1

netbeans ×1

swing ×1

vba ×1