问题列表 - 第30109页

JProgressbar 不显示(没有线程)

我有一个程序需要一些时间来创建 pdf 文件我想向用户显示进度

当我完成一个 pdf 文件时,我尝试调用进度条来更新它的状态:

ProgressDialog progress = new ProgressDialog(instance, numberOfInvoices);
progress.setVisible(true);
progress.setAlwaysOnTop(true);

for(int i = 0 ; i<numOfPdfs ; i++){
    progress.change(i + 1);
}
Run Code Online (Sandbox Code Playgroud)

进度对话框如下所示:

public class ProgressDialog extends JDialog {

    private JProgressBar progressBar;

    public ProgressDialog(Window parent, int aantal) {
        super(parent);

        this.setPreferredSize(new Dimension(300, 150));

        progressBar = new JProgressBar(0, aantal);
        progressBar.setValue(0);
        progressBar.setSize(new Dimension(280, 130));
        this.add(progressBar, BorderLayout.CENTER);

        this.pack();
        this.setLocationRelativeTo(parent);
    }

    public void change(int aantal) {
        if (aantal < progressBar.getMaximum() && aantal >= 0) {
            progressBar.setValue(aantal);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我得到的只是一个空窗口(白色)

我在这个论坛上环顾四周,但踏板解决方案似乎太复杂了 …

java user-interface jprogressbar

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

将Winforms中的标签调整为左侧

我有15到20个标签,文本大小可变,文本框排列在表格中.文本框排列在标签旁边.表单的字体和颜色以及表单控件可以由用户在运行时配置.当我右对齐标签并将auto grow属性设置为true时,无论何时字体样式发生变化(例如从Arial到Georgia),右对齐标签都不再右对齐.

我需要一个标签上的解决方案(用于winforms),以便在字体大小改变时自动增长到左侧.

.net c# windows .net-2.0

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

在pcap文件中收集数据包长度

大家好,我如何收集pcap文件中每个数据包的数据包长度?非常感谢

pcap

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

无法加载文件或程序集

这是我的错误消息:

无法加载文件或程序集'file:/// C:\ Windows\system32\Rule.dll'.该系统找不到指定的文件.

问题是同一个exe在我的开发环境中工作,但在生产服务器上不起作用.该程序是一个应该作为Windows Server 2008上的计划任务运行的工具.它由一个exe,一个所谓的Database.dll和Rule.dll组成.exe应该在代码隐藏中动态加载Rule.dll,但只有从任务计划程序启动时才会出现上述错误.为什么它在System32文件夹中而不是在Application文件夹中?这是UAC问题吗?

'Load the rule engine into memory
Dim asmRule As System.Reflection.Assembly = Nothing
Try
  asmRule = System.Reflection.Assembly.LoadFrom("Rule.dll") 'fails on productive system
Catch ex As System.Exception
  HistoryLog.writeLog("SysLog", ex, "Cannot find Rule.dll in Application Folder")
End Try
Run Code Online (Sandbox Code Playgroud)

.net vb.net dll scheduled-tasks

4
推荐指数
2
解决办法
6395
查看次数

类型泛型的实例

我的问题是:

为什么不能使用新的T()实例化泛型类型,而使用类Class的newInstance()来实现?

java generics

3
推荐指数
2
解决办法
711
查看次数

PHP(5.3)的特殊行为,静态继承和引用

我正在用PHP 5.3编写一个库,其中大部分是一个具有多个静态属性的类,这些属性从子类扩展到允许子类的零-conf.

无论如何,这里有一个样本来说明我发现的特殊性:

<?php

class A {
    protected static $a;
    public static function out() { var_dump(static::$a); }
    public static function setup($v) { static::$a =& $v; }
}
class B extends A {}
class C extends A {}

A::setup('A');
A::out(); // 'A'
B::out(); // null
C::out(); // null

B::setup('B');
A::out(); // 'A'
B::out(); // 'B'
C::out(); // null

C::setup('C');
A::out(); // 'A'
B::out(); // 'B'
C::out(); // 'C'

?>
Run Code Online (Sandbox Code Playgroud)

现在,就我而言,这是静态继承的非常理想的行为,然而,static::$a =& $v;改为static::$a = $v;(无引用)你得到我期望的行为,即:

'A'
'A'
'A' …
Run Code Online (Sandbox Code Playgroud)

php inheritance reference php-5.3

10
推荐指数
1
解决办法
318
查看次数

C-equivalent of the 'setw' function

在c ++中,setw函数用于设置要用作下一个插入操作的字段宽度的字符数.在C中是否有任何函数,我的意思是,在标准c库中,它做同样的事情?

c

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

从DotNet执行存储过程需要很长时间,但在SSMS中它是立即的

我在SQL Server 2000上有一个存储过程,它有3个参数.当我使用SqlCommand.ExecuteReader()从DotNet调用存储过程时,大约需要28秒.

当我在SSMS中直接运行相同的查询时,它会立即返回.

当我从存储过程中取出查询并使用DotNet直接运行时,它也会立即返回.

这些是SQL事件探查器会话的结果

SP内部网点

  • 持续时间:28030
  • 阅读:2663365
  • 写道:0

SP内部SSMS

  • 持续时间:450
  • 阅读:23535
  • 写道:65

直接在Dot Net内部查询

  • 持续时间:360
  • 阅读:24865
  • 写道:57

以下事情对我来说很突出:

  • SSMS中的统计数据和Dot Net中的直接查询非常相似
  • Dot Net SP可以进行大量读取,但不会写入
  • 另外两个读取很少,但有几个写入

任何帮助,将不胜感激.

这是SP的略微观察版本:

我怀疑它是一个查询计划问题,因为即使我从DotNet反复运行它,我总是得到相同的结果.

这是SP的一个版本,由于IP问题而略有改变.我希望它仍然有意义:

SELECT 
t1.pkiOrderID,
t1.fkiBasketId,
t1.sOriginBasketCode,
t1.dtDateCreated,
t1.sOrderCode,
t1.fkiUserCde,
t1.fkiOrgCde,
t1.sApprovalPerson,
t1.dtDateApproved,
t1.sRequestNo,
t1.dtRequiredDate,
t1.Requestor,
t1.OnBehalfOf,
t1.OrderDesc,
t1.OrderTypeId,
t1.fkiAgentID,
t1.fkiAgentRegionID,
stat.iStatus,
count(oi.pkiOrderItemId) as OrderItems,
count(wf.fkiOrderId) as WorkflowCount,
t1.Currency_Id,
t1.ExchangeRate,
t1.ref_odr_idn,
t2.sOrderCode as ref_odr_cde,
t1.ref_rfq_nbr,
t1.ref_rfs_nbr,
t1.ref_doc_nbr,
t1.ref_rsn,
t1.ref_forip_cde,
t1.ref_fa_nbr,
t1.odr_sub_typ
FROM    tbl1 t1 INNER JOIN 
tbl1Status stat ON
t1.pkiOrderID = stat.fkiOrderID AND …
Run Code Online (Sandbox Code Playgroud)

.net c# sql-server ado.net sql-server-2000

7
推荐指数
1
解决办法
5693
查看次数

如何在Android中自定义SeekBar的外观?

SeekBar在我的应用程序中使用了一个,我想稍微定制一下.我已经想出了如何改变Drawable拇指和背景.

我的问题是如何改变大小SeekBar?如果我只是改变SeekBar like this, theView is only clipped and it only shows the top piece of theSeekBar` 的高度:

<SeekBar
   android:layout_height="10dip"
   style="@style/seekbar_style" />
Run Code Online (Sandbox Code Playgroud)

如何更改整体尺寸Seekbar?我希望它比标准更薄SeekBar.

android seekbar

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

Render partial in an extension method fails

I'm creating a tabcontainer that shows information from partials. The code that i've created is as follows:

//Entering extension method, m_helper is of type HtmlHelper
foreach (var tab in m_tabList)
{
    sb.AppendLine("<div class='tabContent'>"); 
    m_helper.RenderPartial(tab.PartialName);
    sb.AppendLine("</div>");    
}
//Returning sb.ToString to the caller method
Run Code Online (Sandbox Code Playgroud)

This will not work because the renderpartial writes directly to the output stream. I cannot render the partial to a string either. to add it to the stringbuilder object.

Any suggestions?

.net c# asp.net-mvc asp.net-mvc-2

3
推荐指数
1
解决办法
374
查看次数