⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lyricswriter.java

📁 Java模仿千千静听音乐播放器源代码
💻 JAVA
字号:
package player.lyrics;
//download:http://www.codefans.net
import player.module.*;
import java.io.*;

public class LyricsWriter {
  public static void wirte(String path){

  }

  public static void wirte(ListItem item, LyricsContent content) {
    File file = item.getFile().getParentFile();
    String name = item.getFile().getName();
    name = name.substring(0, name.lastIndexOf("."));
    file = new File(file.getAbsolutePath() + "\\" + name + ".lrc");
    FileOutputStream out = null;
    PrintStream writer = null;
    try {
      if(!file.exists())file.createNewFile();
      out = new FileOutputStream(file);
      writer = new PrintStream(out);
      writer.println(content.getText());
    }
    catch (Exception e) {
      e.printStackTrace();
    }
    finally {
      try{if(writer != null)writer.close();}catch(Exception e){}
      try{if(out != null)out.close();}catch(Exception e){}
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -