Harrison
2 years ago
5 changed files with 113 additions and 18 deletions
@ -0,0 +1,55 @@
|
||||
package com.fr.design.gui.iprogressbar; |
||||
|
||||
import com.fr.design.utils.DevUtils; |
||||
|
||||
import java.awt.Dimension; |
||||
import java.awt.Frame; |
||||
import java.util.function.Consumer; |
||||
|
||||
/** |
||||
* @author Harrison |
||||
* @version 11.0 |
||||
* Created by Harrison on 2022/11/23 |
||||
*/ |
||||
public class ProgressDialogTest { |
||||
|
||||
public static void main(String[] args) { |
||||
|
||||
mockInitSize(); |
||||
} |
||||
|
||||
/** |
||||
* 模拟 frame 的大小未初始化好的情况 |
||||
*/ |
||||
private static void mockNotInitSize() { |
||||
|
||||
DevUtils.show(new Consumer<Frame>() { |
||||
@Override |
||||
public void accept(Frame frame) { |
||||
|
||||
Dimension origin = frame.getSize(); |
||||
frame.setSize(0, 0); |
||||
ProgressDialog progressDialog = new ProgressDialog(frame); |
||||
progressDialog.setVisible(true); |
||||
progressDialog.updateLoadingText("test"); |
||||
frame.setSize(origin); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 模拟 frame 的大小初始化好的情况 |
||||
*/ |
||||
private static void mockInitSize() { |
||||
|
||||
DevUtils.show(new Consumer<Frame>() { |
||||
@Override |
||||
public void accept(Frame frame) { |
||||
|
||||
ProgressDialog progressDialog = new ProgressDialog(frame); |
||||
progressDialog.setVisible(true); |
||||
progressDialog.updateLoadingText("test"); |
||||
} |
||||
}); |
||||
} |
||||
} |
Loading…
Reference in new issue