久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

IntelliJ IDEA多屏后窗口不顯示問題解決方案

瀏覽:2日期:2024-08-12 18:08:45

IDEA 在接入外接屏且擴(kuò)展的情況下,如果突然拔掉外接屏,就可能會(huì)產(chǎn)生IDEA 整個(gè)窗口只在屏幕的右側(cè)顯示一點(diǎn)點(diǎn)邊框且無法拖拽到當(dāng)前屏幕的情況。

在不再次接入外接屏的情況下,想要把IDEA窗口拖拽回當(dāng)前屏幕,可以找到項(xiàng)目中.idea 文件夾下的workspace.xml 文件全文搜索ProjectFrameBounds 關(guān)鍵字,修改x和y的值為0或者直接將name='x',name='y'的這兩行刪除即可,然后重啟IDEA即可

IntelliJ IDEA多屏后窗口不顯示問題解決方案

因?yàn)榻?jīng)常遇到這種情況,所以自己寫了個(gè)java 小工具,一鍵刪除 name='x',name='y' 這兩行記錄,同時(shí)生成一個(gè)原始文件的.bak 文件,入?yún)⒅恍枰募窂?/p>

其中的核心代碼邏輯示例如下:

(標(biāo)簽: 使用Java 實(shí)現(xiàn)刪除某個(gè)文件中 包含特定字符的行)

import java.io.*;/** * @author jiashubing * @since 2019/5/22 */public class DeleteLine { public static void main(String[] args) { String path = 'C:UsersjiashubingDesktoptttworkspace.xml'; deleteLine(path); } private static String deleteLine(String path) { int a = path.lastIndexOf(’/’); int b = path.lastIndexOf(’’); if (a < 0 && b < 0) { return '沒有目錄分隔符'; } //刪除原來的備份文件 String bakpath = path + '.bak'; if (deleteFile(bakpath)) { return '刪除原始的備份文件失敗,備份文件為:' + bakpath; } String bakpath2 = path + '.bak2'; if (deleteFile(bakpath2)) { return '刪除原始的臨時(shí)備份文件失敗,備份文件為:' + bakpath2; } //創(chuàng)建臨時(shí)備份文件 File bakFile2 = new File(bakpath2); boolean nFlag = false; try { nFlag = bakFile2.createNewFile(); } catch (IOException e) { return '創(chuàng)建臨時(shí)備份文件失敗,備份文件為:' + bakpath2 + ' 錯(cuò)誤信息為:' + e.getMessage(); } if (!nFlag) { return '創(chuàng)建臨時(shí)備份文件失敗,備份文件為:' + bakpath2; } String ans = getAns(path); if (ans == null) { return '讀取并修改原始文件失敗'; } if (!addNewFile(bakpath2, ans)) { return '將修改后的內(nèi)容寫入到新文件失敗'; } File oldFile = new File(path); boolean mvFlag = oldFile.renameTo(new File(bakpath)); if (!mvFlag) { return '將原始文件重命名成備份文件失敗'; } boolean mvFlag2 = bakFile2.renameTo(new File(path)); if (!mvFlag2) { return '將臨時(shí)備份文件重命名成原始文件失敗'; } return '執(zhí)行成功'; } private static boolean deleteFile(String bakpath) { File bakFile = new File(bakpath); if (bakFile.exists() && bakFile.isFile()) { boolean delFlag = bakFile.delete(); if (!delFlag) {return true; } } return false; } private static String getAns(String path) { File oldFile = new File(path); if (!oldFile.exists() || !oldFile.isFile()) { return null; } StringBuilder ans = new StringBuilder(); String encoding = 'UTF-8'; try (InputStreamReader read = new InputStreamReader(new FileInputStream(oldFile), encoding); BufferedReader bufferedReader = new BufferedReader(read)) { String lineTxt = null; while ((lineTxt = bufferedReader.readLine()) != null) {if (lineTxt.contains('name='x'') || lineTxt.contains('name='y'')) { continue;}ans.append(lineTxt + 'n'); } } catch (Exception e) { return null; } return ans.toString(); } private static boolean addNewFile(String path, String ans) { File file = new File(path); try (Writer out = new FileWriter(file)) { out.write(ans); } catch (IOException e) { return false; } return true; }}

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: IDEA
相關(guān)文章:
主站蜘蛛池模板: 申扎县| 新巴尔虎右旗| 元阳县| 桃园市| 五峰| 佛教| 西乌| 长岛县| 东源县| 咸宁市| 廊坊市| 长春市| 太和县| 昌吉市| 资溪县| 且末县| 清河县| 慈溪市| 赤水市| 靖州| 紫云| 松溪县| 汉川市| 共和县| 长子县| 乌海市| 富阳市| 和林格尔县| 玛纳斯县| 宣威市| 六盘水市| 江北区| 长寿区| 宜昌市| 南乐县| 和顺县| 措美县| 长岛县| 泾川县| 五莲县| 辽源市|