webstorm界面字体太大部分功能点不到?
发布网友
发布时间:2022-05-17 10:41
我来回答
共2个回答
热心网友
时间:2023-10-19 08:11
1、首先打开webstorm软件,打开点击左上角File。
2、然后点击弹出的菜单里的setting选项,也可以使用快捷键Crtl+Alt+S快速打开设置选项。
3、然后在设置里进入Appearance & Behavior点击Appearance选项,之后编辑如图的Size,就是调节界面字体大小。
4、接继续点击进入Editor,选择Font选项,在右侧就能设置编码界面上的字体大小了,将size的数值改为自己需要的数字,比如这里设置为20。
5、设置完点右下角的ok即可设置完成。
6、最后回到软件界面,可以看到界面文字和编辑区的文字都变大了。
热心网友
时间:2023-10-19 08:11
package com.zouqi.excel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.zouqi.util.POIUtils;
import com.zouqi.util.StringUtils;
public class DataExtendtion extends JFrame {
/**
*
*/
private static final long serialVersionUID = -3342204088626688468L;
private static final String COMMA = ",";
private static final String DEFAULT_ABSTRACT_CONTENT = "EMPTY";
//private JButton btn;
private JPanel contentPane; // 内容面板
private JTextField textField; // 文本框
public DataExtendtion() {
setTitle("选择文件"); // 设置窗体的标题
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 设置窗体退出时操作
setBounds(100, 100, 800, 400); // 设置窗体位置和大小
contentPane = new JPanel(); // 创建内容面板
contentPane.setBorder(new EmptyBorder(100, 5, 5, 5)); // 设置面板的边框
contentPane.setLayout(new BorderLayout(0, 0)); // 设置内容面板为边界布局
setContentPane(contentPane); // 应用内容面板
JPanel panel1 = new JPanel(); // 新建面板用于保存文本框
panel1.setBounds(5, 100, 800, 100);
contentPane.add(panel1, BorderLayout.NORTH); // 将面板放置在边界布局的北部
textField = new JTextField(); // 新建文本框
panel1.add(textField); // 将文本框增加到面板中
textField.setPreferredSize(new Dimension(400, 40));
final JButton btn = new JButton("选择文件");
btn.setPreferredSize(new Dimension(100, 40));
panel1.add(btn);
btn.setBackground(Color.GREEN);
JPanel panel2 = new JPanel(); // 新建面板用于保存按钮
contentPane.add(panel2, BorderLayout.CENTER); // 将面板放置在边界布局的*
JButton okBtn = new JButton("确定");
okBtn.setPreferredSize(new Dimension(100, 40));
panel2.add(okBtn);
setVisible(true);
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// 按钮点击事件
JFileChooser chooser = new JFileChooser(); // 设置选择器
chooser.setMultiSelectionEnabled(true); // 设为多选
int returnVal = chooser.showOpenDialog(btn); // 是否打开文件选择框
System.out.println("returnVal=" + returnVal);
if (returnVal == JFileChooser.APPROVE_OPTION) { // 如果符合文件类型
String filepath = chooser.getSelectedFile().getAbsolutePath(); // 获取绝对路径
System.out.println(filepath);
textField.setText(filepath);
}
}
});
/* 确定点击 */
okBtn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String filepath = textField.getText();
if ("".equals(filepath) || filepath == null) {
JOptionPane.showMessageDialog(getContentPane(), "请先选择文件~", "警告", JOptionPane.WARNING_MESSAGE);
return;
}
String suffix = filepath.substring(filepath.lastIndexOf(".") + 1);
System.out.println(suffix);
if (!(suffix.equals("xlsx") || (suffix.equals("xls")))) {
JOptionPane.showMessageDialog(getContentPane(), "请选择Excel文件~", "警告", JOptionPane.WARNING_MESSAGE);
return;
}
/* 打开文件 */
try {
openFile(filepath, suffix);
} catch (Exception e1) {
JOptionPane.showMessageDialog(getContentPane(), "出错了,请联系工程师", "警告", JOptionPane.ERROR_MESSAGE);
e1.printStackTrace();
}
}
});
}
/* 打开对应的Excel文件 */
public void openFile(String filepath, String suffix) throws IOException {
FileInputStream fileInputStream = new FileInputStream(new File(filepath));
Workbook workbook = null;
if(suffix.equals("xlsx")) {
workbook = new XSSFWorkbook(fileInputStream);
}else {
workbook = new XSSFWorkbook(fileInputStream);
}
Sheet oldSheet = workbook.getSheetAt(1);
Map<String, String> map = queryRows(workbook);
Set<Entry<String, String>> itSet = map.entrySet();
for (Entry<String, String> entry : itSet) {
int rowNum = 1;
Sheet sheet = workbook.createSheet(entry.getKey());
String rowNums = entry.getValue();
String[] rowNumArr = rowNums.split(COMMA);
//创建标题行
Row oldTitleRow = oldSheet.getRow(1);
Row newTitleRow = sheet.createRow(0);
POIUtils.copyRow(workbook, oldTitleRow, newTitleRow, true);
//收入
double incomeCount = 0.0;
//支出
double expendCount = 0.0;
//创建内容行
for(int i = 1; i <= rowNumArr.length; i++) {
Row oldRow = oldSheet.getRow(Integer.valueOf(rowNumArr[i-1]));
Row newRow = sheet.createRow(i);
newRow = POIUtils.copyRow(workbook, oldRow, newRow, true);
String income = POIUtils.getCellValue(newRow.getCell(3));
if(StringUtils.isNotNull(income)) {
incomeCount += Double.valueOf(income);
}
String expend = POIUtils.getCellValue(newRow.getCell(4));
if(StringUtils.isNotNull(expend)) {
expendCount += Double.valueOf(expend);
}
rowNum++;
}
//创建合计行
Row newCountRow = sheet.createRow(rowNum);
Cell cell00 = newCountRow.createCell(0);
cell00.setCellValue("合计");
Cell cell01 = newCountRow.createCell(1);
cell01.setCellValue("");
Cell cell02 = newCountRow.createCell(2);
cell02.setCellValue("");
Cell cell03 = newCountRow.createCell(3);
cell03.setCellValue(incomeCount);
Cell cell04 = newCountRow.createCell(4);
cell04.setCellValue(expendCount);
}
//D:\Users\qi.zou\Documents\aaa\bbb.xlsx
File file = createFile(filepath);
workbook.write(new FileOutputStream(file));
JOptionPane.showMessageDialog(getContentPane(), "处理完成!", "处理完成", JOptionPane.INFORMATION_MESSAGE);
}
/* 检索需要信息 */
public Map<String, String> queryRows(Workbook workbook) {
Sheet sheet = workbook.getSheetAt(1);
Map<String, String> map = new HashMap<>();
for (int i = 3; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i);
if(row == null) {
continue;
}
String cell00Value = POIUtils.getCellValue(row.getCell(0));
if("合计".equals(cell00Value)){
break;
}
Cell cell = row.getCell(1);
//摘要内容
String abstractContent = POIUtils.getCellValue(cell);
if(StringUtils.isNull(abstractContent)) {
abstractContent = DEFAULT_ABSTRACT_CONTENT;
}
String rowNum = map.get(abstractContent);
if(rowNum == null) {
rowNum = String.valueOf(i);
map.put(abstractContent, rowNum);
continue;
}
rowNum = rowNum + COMMA + String.valueOf(i);
map.put(abstractContent, rowNum);
}
return map;
}
/**在选择的文件同级目录下 创建一个文件*/
private static File createFile(String oldfilePath) throws IOException {
File f = new File(oldfilePath);
if (!f.exists()) { // 判断原文件是否存在
return null;
}
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
String dateName = format.format(date);
String newFilePath = oldfilePath.substring(0, oldfilePath.lastIndexOf("\\")) + "\\" + dateName ;
File fileDirectoryFile = new File(newFilePath);
File nf = new File(newFilePath + "\\" + "result.xlsx");
if (!fileDirectoryFile.exists()) {
fileDirectoryFile.mkdirs();
}
if (!nf.exists()) {
nf.createNewFile();
}
return nf;
}
public static void main(String[] args) {
new DataExtendtion();
}
}